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

# NexLLM API Reference: Endpoints and Base URL Guide

> Explore NexLLM's OpenAI-compatible REST API at https://www.nexllm.ai/v1, covering chat, embeddings, images, audio, and more in one unified gateway.

NexLLM provides a unified, OpenAI-compatible REST API that lets you access GPT, Claude, and Gemini models through a single base URL. You can drop NexLLM into any project already using the OpenAI SDK — just swap the base URL and your NexLLM API key, and your existing code keeps working without any other changes.

## Base URL

Every request you make goes to the following base URL:

```
https://www.nexllm.ai/v1
```

<Note>
  To use NexLLM with the OpenAI SDK, set `base_url="https://www.nexllm.ai/v1"` and pass your NexLLM API key as `api_key`. No other configuration changes are required.
</Note>

## Supported Endpoints

The table below lists every endpoint NexLLM exposes. All paths are relative to the base URL above.

| Endpoint         | Method & Path                   | Description                                               |
| ---------------- | ------------------------------- | --------------------------------------------------------- |
| Chat Completions | `POST /v1/chat/completions`     | Generate conversational responses, with streaming support |
| Text Completions | `POST /v1/completions`          | Legacy text completion for prompt-based generation        |
| Embeddings       | `POST /v1/embeddings`           | Convert text to vector embeddings                         |
| Image Generation | `POST /v1/images/generations`   | Generate images from text prompts                         |
| Image Editing    | `POST /v1/images/edits`         | Edit or modify images                                     |
| Speech-to-Text   | `POST /v1/audio/transcriptions` | Transcribe audio to text                                  |
| Text-to-Speech   | `POST /v1/audio/speech`         | Convert text to spoken audio                              |
| Rerank           | `POST /v1/rerank`               | Rerank documents by relevance                             |
| Responses API    | `POST /v1/responses`            | OpenAI Responses API-compatible format                    |
| Realtime         | `GET /v1/realtime` (WebSocket)  | Real-time interactions                                    |
| Models           | `GET /v1/models`                | List available models                                     |
| Claude Messages  | `POST /v1/messages`             | Claude native format (Anthropic Messages API)             |

## Native Format Support

In addition to the OpenAI-compatible endpoints above, NexLLM also supports provider-native request formats:

<Note>
  **Claude native format** — Send requests to `POST /v1/messages` using the `x-api-key: sk-...` header and `anthropic-version: 2023-06-01` header. This lets you use the Anthropic Messages API format directly, without converting to OpenAI-style payloads.
</Note>

<Note>
  **Gemini native format** — Send requests to `GET /v1beta/models/{model}:generateContent?key=sk-...` using the standard Gemini query-parameter authentication. Replace `{model}` with the model name (e.g. `gemini-2.5-flash`).
</Note>

## Explore the API

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/api-reference/authentication">
    Learn how to authenticate your requests using the `Authorization` header or native provider headers.
  </Card>

  <Card title="Chat Completions" icon="message" href="/api-reference/chat-completions">
    Generate conversational AI responses with full streaming support.
  </Card>

  <Card title="Embeddings" icon="vector-square" href="/api-reference/embeddings">
    Convert text into vector embeddings for semantic search and RAG pipelines.
  </Card>

  <Card title="Image Generation" icon="image" href="/api-reference/image-generation">
    Generate and edit images from natural language prompts.
  </Card>

  <Card title="Audio" icon="microphone" href="/api-reference/audio">
    Transcribe audio files to text or synthesize speech from text.
  </Card>

  <Card title="Models" icon="list" href="/api-reference/models">
    Retrieve the full list of models available to your API key.
  </Card>
</CardGroup>
