# API developer experience: polishing the API's public interface
Source: https://speakeasy.com/api-design/developer-experience

Developer experience is a buzz word and so it's prone to hyperbole. It's not the end all be all that some people on social make it out to be. Nor is it irrelevant like some detractors claim. It is one of many important aspects of building an API (or any developer product).

It's the final coat of polish that makes the product easily usable by the developer community. Done well, it can be the difference between winning and losing an RFP, between a successful and unsuccessful PLG motion.

For an understanding of the impact great developer experience can have, let's take a look at Stripe, the canonical example company that wrote the playbook.

## What Stripe got right: A case study in API excellence

[Stripe's](https://stripe.com/) API sets the gold standard for developer experience because it makes life easy for developers at every touchpoint. In 2011, Stripe was the first to offer an API-first approach to payments, and its evident in the number of startups that have popped up aiming to be the "Stripe for X".

Let's take a look at what Stripe does right.

### SDK libraries

No one wants to manually write API requests from scratch. Providing well-maintained SDKs in popular programming languages like Python, JavaScript, and Go can save developers countless hours of having to write boilerplate code for the API.

Because SDKs are written in the language that's targeted, they can be more idiomatic when it comes to type safety. An SDK also makes it easier to predict how an API will respond to a request since the response object is typed.

Stripe offers well-maintained SDKs for major programming languages and frameworks, making it easy to integrate payments without having to reinvent the wheel.

For example, here's how to create a payment intent using Stripe's Python SDK compared to making a raw API request:

<div className="min-[1660px]:flex gap-6 justify-center [&>div]:min-[1660px]:max-w-[50%]">
  <div>
```python filename="stripe_sdk_example.py"
import stripe

stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

intent = stripe.PaymentIntent.create(
amount=1000,
currency="usd",
payment_method_types=["card"],
)
```
  </div>
  <div>
```python filename="stripe_api_example.py"
import requests

url = "https://api.stripe.com/v1/payment_intents"
headers = {
  "Authorization": "Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"
}
data = {
  "amount": 1000,
  "currency": "usd",
  "payment_method_types": ["card"]
}
response = requests.post(url, headers=headers, data=data)
print(response.json())
```

  </div>
</div>

### Sandbox environments for testing

Experimenting is the easiest way to understand a tool. With sandboxes, developers can test their integrations without worrying about rate limits, API call costs, or breaking anything.

Stripe makes it effortless by providing [sandbox environments](https://docs.stripe.com/sandboxes) that mirror production. This allows teams to simulate real-world scenarios without touching real money.

### Offer developer-first documentation

Stripe nailed documentation by making it more than just a reference guide. Their documentation isn't just a manual — it's an experience.

With clear, concise explanations, real-world examples, and interactive API explorers, developers can go from zero to functional in minutes. The Stripe docs offer code snippets in multiple languages, ensuring that whether using Python, Node.js, or Ruby, having a starting point. To complete the loop, the code snippets reference the Stripe SDKs for the different languages.

For example, need to process a payment? Stripe provides a simple copy-paste code snippet that works right out of the box:

```python
import stripe

stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

charge = stripe.Charge.create(
    amount=2000,
    currency="usd",
    source="tok_visa",
    description="Charge for test@example.com"
)
```

## How to make an API like Stripe

Here are some strategies to ensure an API is not just functional but feels intuitive, reduces friction, and empowers developers to achieve their goals quickly and effectively.

### Understand the users' needs

Different APIs serve different user bases. For instance, a payments API like Stripe caters to a different audience compared to Spotify's API for music data. An enterprise team integrating a merchant payments API will have different needs than a solo developer building a music app with a single pricing tier.

Understanding the audience is the first step to creating an API that meets their needs - and keeping it stable for them over time. Enterprise teams need long-term consistency with clear versioning, while solo developers need flexibility without unexpected breaking changes.

### Make onboarding and authentication frictionless

The difference between a good and bad API often comes down to onboarding. Just ask [@levelsio](https://x.com/levelsio/status/1853774638473437451), who compared xAI and Google Gemini's APIs:

<div className="mx-auto max-w-md">
  ![levelsio tweet](/assets/api-design/twitter-levels-screenshot.png)
</div>

While xAI needed only an API key, Google Gemini required multiple sign-ups, portal logins, and complex installation steps. For enterprise teams, inconsistent authentication across endpoints or juggling multiple keys can be equally frustrating.

The solution? Provide simple API key authentication where possible:

```python