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

# Introduction

> Serverless LLM inference on PrimaLabs — OpenAI-compatible, one bearer key, pay per token.

PrimaLabs serves open models over a **serverless, OpenAI-compatible API**. Point any
OpenAI SDK at our base URL, pass an API key, and call a model — no infrastructure to run,
no reserved capacity, billed per token.

## Base URL

```
https://api.primalabs.ai/v1
```

Every endpoint in these docs is relative to this base URL.

## Authentication

Send your API key as a bearer token on every request:

```
Authorization: Bearer YOUR_API_KEY
```

Create a key in the [dashboard](https://dashboard.primalabs.ai). See
[Authentication](/inference/authentication).

## OpenAI-compatible

The API mirrors the OpenAI wire format, so existing OpenAI clients work with only a base
URL and key change:

<CodeGroup>
  ```bash cURL theme={null}
  curl -sS https://api.primalabs.ai/v1/chat/completions \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "primalabs-ai/DeepSeek-V4-Flash-0731",
      "messages": [{"role": "user", "content": "Hello"}]
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.primalabs.ai/v1",
      api_key="YOUR_API_KEY",
  )

  r = client.chat.completions.create(
      model="primalabs-ai/DeepSeek-V4-Flash-0731",
      messages=[{"role": "user", "content": "Hello"}],
  )
  print(r.choices[0].message.content)
  ```

  ```javascript Node theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.primalabs.ai/v1",
    apiKey: "YOUR_API_KEY",
  });

  const r = await client.chat.completions.create({
    model: "primalabs-ai/DeepSeek-V4-Flash-0731",
    messages: [{ role: "user", content: "Hello" }],
  });
  console.log(r.choices[0].message.content);
  ```
</CodeGroup>

## Endpoints

| Endpoint                 | Purpose                                 |
| ------------------------ | --------------------------------------- |
| `POST /chat/completions` | Chat completions (primary)              |
| `POST /completions`      | Legacy text completions                 |
| `POST /embeddings`       | Text embeddings                         |
| `POST /rerank`           | Document reranking                      |
| `POST /messages`         | Anthropic Messages format (passthrough) |
| `POST /responses`        | OpenAI Responses format (passthrough)   |
| `GET /models`            | The models your key can call            |
| `GET /model/info`        | Pricing and context window per model    |

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/inference/quickstart">
    Make your first request in under a minute.
  </Card>

  <Card title="Models" icon="layer-group" href="/inference/models">
    The catalog, pricing, and context windows.
  </Card>

  <Card title="Rate limits" icon="gauge-high" href="/inference/rate-limits">
    The three limits in front of every request.
  </Card>

  <Card title="Service status" icon="signal" href="https://status.primalabs.ai">
    Live uptime per model, incidents, and email updates.
  </Card>
</CardGroup>
