# A unified AI API: one endpoint, every provider dialect

> OpenAI ships /chat/completions, Anthropic ships /messages, OpenAI's newer surface is /responses. A unified AI API speaks all of them at one URL, so the client library you already use keeps working. You swap the base URL, not the code.

- Date: July 12, 2026
- Category: guides
- HTML: https://anyrouter.dev/blog/unified-ai-api-one-endpoint

## Unify the contract, not just the routing

Routing many models behind one endpoint solves half the fragmentation problem. The other half is dialect: OpenAI's SDK expects /chat/completions, Anthropic's SDK expects /messages, and OpenAI's newer Responses API expects /responses. A unified AI API implements all three request shapes on one surface, so whichever SDK your codebase already speaks keeps working unchanged.

| Dialect | Endpoint | For |
| --- | --- | --- |
| OpenAI chat | /api/v1/chat/completions | Drop-in for OpenAI's chat SDK |
| Anthropic messages | /api/v1/messages | Drop-in for Claude clients |
| OpenAI Responses | /api/v1/responses | The newer OpenAI Responses surface |
| Embeddings | /api/v1/embeddings | OpenAI-style vector embeddings |

## The same model, two dialects

Because the contract is the standard API, you keep the client library you have and just point it at AnyRouter. An OpenAI client:

```python
from openai import OpenAI

client = OpenAI(base_url="https://anyrouter.dev/api/v1", api_key="sk-ar-v1-...")
resp = client.chat.completions.create(
  model="anthropic/claude-opus-4-8",
  messages=[{"role": "user", "content": "Hello"}],
)
```

_OpenAI SDK, swap the base URL, keep the code._

…or an Anthropic client, against the same account and key:

```python
from anthropic import Anthropic

client = Anthropic(base_url="https://anyrouter.dev/api", api_key="sk-ar-v1-...")
msg = client.messages.create(
  model="anthropic/claude-opus-4-8",
  max_tokens=256,
  messages=[{"role": "user", "content": "Hello"}],
)
```

_Anthropic SDK, same key, the /messages surface._

## No SDK lock-in

A unifying layer is only safe if leaving it is easy. Every surface here is a public standard, not a proprietary protocol. The same code points straight back at OpenAI or Anthropic if you ever move on. Model ids become `provider/model` strings, so choosing a model is a config value, and you get one key, one bill, and one audit log across every dialect.

This is the contract side of the story. For the routing side, automatic failover and provider preferences across hundreds of models, see /blog/one-api-every-llm.

One endpoint that speaks OpenAI chat, Anthropic /messages, and the Responses API.

[See the unified API](https://anyrouter.dev/unify-api)
