> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI-compatible API

> Use Orq.ai as an OpenAI-compatible API proxy. Access 300+ LLM models with the existing OpenAI SDK by changing only the base URL.

The **AI Gateway** exposes endpoints that are fully compatible with the OpenAI API, letting you use every model available in the **AI Gateway** without changing your application logic. Keep the existing OpenAI client, point it to the Orq.ai proxy baseURL, and continue as usual.

<Info>
  For the OpenAI API specification, see [the API Reference](https://platform.openai.com/docs/api-reference/chat)
</Info>

<Check>
  **Drop-in Integration (No Code Changes)**

  1. Keep your existing OpenAI SDK or HTTP integration.
  2. Set the base URL to `https://api.orq.ai/v3/router`
  3. Use the Orq.ai [API Key](/docs/ai-gateway/configuration/api-keys) in the Authorization header.
  4. Call the same endpoints and payloads already used with OpenAI.
</Check>

## Base URL

OpenAI-compatible endpoint:

<CodeGroup>
  ```text URL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  https://api.orq.ai/v3/router
  ```
</CodeGroup>

All routes below are relative to this base URL and mirror OpenAI’s request/response formats.

## Authentication

Authenticate with the Orq.ai API key via the `Authorization: Bearer $ORQ_API_KEY` header.

<Info>
  To learn more about Orq API Key, see [API Key](/docs/ai-gateway/configuration/api-keys).
</Info>

Minimum headers:

* `Authorization: Bearer $ORQ_API_KEY`
* `Content-Type: application/json`

## Supported Endpoints

Schema, parameters, and response formats match the OpenAI API.

* `GET /models`: List available models
* `GET /models/{model}`: Get model details
* `POST /chat/completions`: Chat completions (supports streaming, images, files, and tool calls)
* `POST /completions`: Text completions
* `POST /embeddings`: Vector embeddings
* `POST /images/generations`: Image generation
* `POST /images/edits`: Image editing
* `POST /images/variations`: Image variations
* `POST /moderations`: Text moderation
* `POST /rerank`: Rerank results
* `POST /speech`: Text-to-speech
* `POST /audio/transcriptions`: Transcribe audio into the input language
* `POST /audio/translations`: Translate audio into the input language
* `POST /responses`: Create a model response with built-in tools ([Web Search](/docs/ai-gateway/features/web-search))

## Models

Use the model field exactly as you would with OpenAI, substituting the ID of any model available in the [AI Gateway Models](/docs/ai-gateway/using-the-router).

## Error Handling & Compatibility Notes

* HTTP status codes and error structures follow OpenAI’s conventions.
* Streaming, function/tool calls, and multimodal inputs (images/files) are supported on /chat/completions.
* The AI Gateway is versioned under `/v3/router`. Ensure clients target this path.

***
