# Quick start

> goodapi provides model APIs compatible with the OpenAI and Anthropic formats. Point the Base URL at goodapi, add an API key from the console, and you're ready to go.

If your code already uses the OpenAI or Anthropic SDK, change just two things — the Base URL and the key. The way you call the API stays the same.

## Base URL

| API format | Base URL | Notes |
|---|---|---|
| OpenAI format (Chat Completions, Responses) | `https://api.goodapi.tech/v1` | Includes `/v1` |
| Anthropic format (Messages) | `https://api.goodapi.tech` | **No** `/v1` — the SDK appends `/v1/messages` itself |

Authenticate with the `Authorization: Bearer sk-...` header. The Anthropic format also accepts `x-api-key` plus `anthropic-version`, which is what the official Anthropic SDK sends by default.

## Three steps

1. **Sign up and add credit**: [create an account](https://api.goodapi.tech/sign-up), then top up on the Wallet page in the console. goodapi uses prepaid credit that is charged per request; see [Billing](/en/docs/billing).
2. **Create an API key**: create one on the API Keys page in the console. You must pick a **group** when you create it, and a key can only call models in that group; see [API keys](/en/docs/api-key).
3. **Send your first request**: put the key in an environment variable and try the cURL command below.

## Your first request

```bash
export GOODAPI_API_KEY="sk-..."   # replace with your key

curl https://api.goodapi.tech/v1/chat/completions \
  -H "Authorization: Bearer $GOODAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

`deepseek-v4-flash` in this example belongs to the DeepSeek group, so the key must be created in that group. To use another model, look up its name and group in [Models and pricing](/en/docs/models).

On success you get OpenAI-format JSON with the reply text in `choices[0].message.content`. If you get an error, look it up in [Error codes](/en/docs/errors).

## Using an SDK

OpenAI SDK (Python):

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["GOODAPI_API_KEY"],
    base_url="https://api.goodapi.tech/v1",
)

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
```

Anthropic SDK (Python). The Base URL has no `/v1`, and the key must be created in the group that contains the Claude model:

```python
import os
import anthropic

client = anthropic.Anthropic(
    api_key=os.environ["GOODAPI_API_KEY"],
    base_url="https://api.goodapi.tech",
)

message = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)
```

## Next steps

- [Endpoint overview](/en/docs/endpoints): which models each API format supports
- [Models and pricing](/en/docs/models): every model, its group and its price
- [Balance and usage](/en/docs/usage): check quota and request history with the key itself
- [Clients](/en/docs/clients): use goodapi in Claude Code, Codex and opencode
- [Error codes](/en/docs/errors): common errors and how to fix them
