# Gateway docs

One API for the models you use. Gateway picks a model that can handle each request, moves to another provider when one fails, converts files the model can’t read when you ask it to, and records what every attempt cost.

```bash title="POST /v1/chat/completions"
curl https://api.momor.ai/v1/chat/completions \
  -H "Authorization: Bearer $MOMOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.4-mini",
    "max_tokens": 1024,
    "messages": [
      { "role": "user", "content": "Summarise this contract in three points." }
    ]
  }'
```

```python
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.momor.ai/v1", api_key=os.environ["MOMOR_API_KEY"])

reply = client.chat.completions.create(
    model="openai/gpt-5.4-mini",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Summarise this contract in three points."}],
)
print(reply.choices[0].message.content)
```

```typescript
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.momor.ai/v1", apiKey: process.env.MOMOR_API_KEY });

const reply = await client.chat.completions.create({
  model: "openai/gpt-5.4-mini",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Summarise this contract in three points." }],
});
console.log(reply.choices[0].message.content);
```

```csharp
using System.ClientModel;
using OpenAI;
using OpenAI.Chat;

var client = new ChatClient(
    model: "openai/gpt-5.4-mini",
    credential: new ApiKeyCredential(Environment.GetEnvironmentVariable("MOMOR_API_KEY")!),
    options: new OpenAIClientOptions { Endpoint = new Uri("https://api.momor.ai/v1") });

ChatCompletion reply = await client.CompleteChatAsync(
    [new UserChatMessage("Summarise this contract in three points.")],
    new ChatCompletionOptions { MaxOutputTokenCount = 1024 });
Console.WriteLine(reply.Content[0].Text);
```

Gateway accepts the OpenAI Chat Completions format, so existing SDKs work once you change the base URL and key. Momor’s own API, [POST /models](/docs/gateway/reference/chat/), adds typed messages, file processing and a choice of what a broken stream does. Start with the [quickstart](/docs/gateway/quickstart/).

## Where to go next

- [Quickstart](/docs/gateway/quickstart/): Get a key and send your first request in a few minutes.
- [Model catalog](/docs/gateway/models/): Every model, the providers that serve it, its limits and price.
- [Create a chat completion](/docs/gateway/reference/chat-completions/): Every field Gateway reads, the response, and the errors you can get.
- [Provider failover](/docs/gateway/failover/): What happens when a provider fails before it answers, and when it fails mid-answer.
- [File processing](/docs/gateway/files/): Send documents, images and recordings to any model. Gateway converts what the model can’t read when you ask it to.
- [Bring your own keys](/docs/gateway/bring-your-own-keys/): Run calls on your own provider accounts, sent with a call or saved for your organization.
