# OpenAI-compatible

> Configure openaicompatible deployments and understand provider-specific behavior.

URL: https://boelabs.com/en/docs/ai-gateway/providers-openai-compatible
Language: English

Use this adapter for an API that implements OpenAI's Chat Completions (or compatible Images/Embeddings)
contract but isn't one of the named providers — self-hosted vLLM/SGLang deployments, aggregators, or a
provider AI Gateway doesn't have a dedicated adapter for yet.

## Configure a deployment

Send this body to `POST /admin/deployments` with an operator credential. Replace the example
credentials and choose a model available to your provider account. See
[Creating deployments](https://boelabs.com/docs/ai-gateway/creating-deployments) for the shared configuration fields.

```json
{
  "publicModel": "my-model",
  "adapterKey": "openaicompatible",
  "upstreamModel": "some-vendor/some-model",
  "credentials": { "apiKey": "...", "baseUrl": "https://api.vendor.example/v1" }
}
```

## Behavior and limitations

- **Credentials**: `apiKey`, `baseUrl` (both required — there's no built-in default host).
- **Default transport**: Chat Completions for text, `images` for image generate/edit, `videos` for
  OpenAI-shaped video APIs, and `embeddings` for embeddings.
- **Compatibility goal**: this adapter covers the common OpenAI-shaped surface and stays extensible
  through `catalogEntry`, `transportOverrides`, and `credentials.headers`. It does not promise perfect
  behavior for every aggregator quirk or proprietary OpenAI feature.
- **Strict tools**: declare `capabilities.strictTools: true` only when the target itself guarantees
  schema-adherent function arguments. The adapter forwards each tool's `strict` flag natively and
  rejects strict requests when the catalog does not make that guarantee.
- Since the gateway can't know this model's real capabilities, **`catalogEntry` is required** — declare
  `operations`, `capabilities`, and `parameters` by hand. See [Model catalog](https://boelabs.com/docs/ai-gateway/model-catalog) and
  the custom-model example in [Creating deployments](https://boelabs.com/docs/ai-gateway/creating-deployments).
- **Aggregators and hosted compatible APIs** use this same adapter with an explicit `baseUrl`. If an
  operation needs a provider-specific transport shape, set
  `transportOverrides` explicitly, such as `image.generate: "chat_completions"` or
  `video.generate: "videos_async"`.
- If the target speaks vLLM/SGLang-style thinking controls (`chat_template_kwargs`), declare
  `reasoning.kind: "chat_template_flag"` in the custom catalog entry — see [Reasoning](https://boelabs.com/docs/ai-gateway/reasoning).

## Next steps

- [Creating deployments](https://boelabs.com/docs/ai-gateway/creating-deployments) — the full custom-model example.
- [Model catalog](https://boelabs.com/docs/ai-gateway/model-catalog) — the catalog entry a custom model must declare.

