# Overview (/docs)

OhMyGPT gives you one API key and one balance for models from OpenAI, Anthropic, Google, DeepSeek and many other providers. Keep the SDK you already use, change the base URL and the key, and switch models by changing one string:

```python
from openai import OpenAI

client = OpenAI(base_url="https://api.ohmygpt.com/v1", api_key="sk-...")

for model in ["openai/gpt-5.4-nano", "anthropic/claude-sonnet-5-5", "zhipu/glm-5.3-flash"]:
    reply = client.chat.completions.create(
        model=model,
        messages=[{"role": "user", "content": "Say hello in one word."}],
    )
    print(model, reply.choices[0].message.content)
```

- **Test for free.** The `ohmygpt/mock` model answers every endpoint at no cost, so you can check your integration before spending anything.
- **See every charge.** Each response carries its exact cost in the `X-Cost-Credits` header.
- **Failover is built in.** When a model has several providers and one fails before answering, OhMyGPT sends the request to another. Your code makes one call.

## Base URL and protocols [#base-url-and-protocols]

The base URL is `https://api.ohmygpt.com`. Chat models accept all four protocols below, so you can call a Claude model through the OpenAI SDK, or a GPT model through the Anthropic SDK. The [model list](/docs/model-naming) shows the endpoints each model accepts.

| Protocol | Endpoint | SDK base URL | Key header |
|---|---|---|---|
| OpenAI Chat Completions | `POST /v1/chat/completions` | `https://api.ohmygpt.com/v1` | `Authorization: Bearer` |
| OpenAI Responses | `POST /v1/responses` | `https://api.ohmygpt.com/v1` | `Authorization: Bearer` |
| Anthropic Messages | `POST /v1/messages` | `https://api.ohmygpt.com` | `x-api-key` |
| Gemini | `POST /v1/models/{model}:generateContent` | `https://api.ohmygpt.com`, API version `v1` | `x-goog-api-key` |

<Callout type="warn">
  The Anthropic SDK and Claude Code add `/v1/messages` to the base URL themselves. Set the base URL to `https://api.ohmygpt.com`, without `/v1`.
</Callout>

## Start here [#start-here]

<Cards>
  <Card title="Quickstart" href="/docs/quickstart" description="Make your first call in two minutes" />
  <Card title="Model IDs" href="/docs/model-naming" description="Find the ID for the model you want" />
  <Card title="API keys" href="/docs/api-keys" description="Spending limits, allowed models and rate limits" />
  <Card title="Provider routing" href="/docs/provider-routing" description="Choose which provider serves a model" />
  <Card title="Costs" href="/docs/costs" description="See exactly what each request cost" />
  <Card title="Errors" href="/docs/errors" description="Status codes and what to do about each" />
  <Card title="Claude Code" href="/docs/code-cli/claude-code" description="Point a coding tool at OhMyGPT" />
  <Card title="API reference" href="/docs/api" description="Every endpoint and parameter" />
</Cards>
