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

# API Playground

> Interactive API reference — test every endpoint directly in the browser with your API key.

<Note>
  Enter your API key in the **Authentication** field at the top of each endpoint page to send live requests. All calls go to `https://www.samuraiapi.in/v1`.
</Note>

## Base URL

```
https://www.samuraiapi.in/v1
```

## Authentication

All requests require a `Bearer` token:

```http theme={null}
Authorization: Bearer sk-samurai-YOUR_KEY
```

Get your API key from the [Dashboard](https://www.samuraiapi.in/dashboard).

## Available Endpoints

<CardGroup cols={2}>
  <Card title="Chat Completions" icon="message" href="/api-reference/endpoint/chat-completions">
    `POST /chat/completions` — Generate text with any model
  </Card>

  <Card title="List Models" icon="list" href="/api-reference/endpoint/list-models">
    `GET /models` — See all available models
  </Card>

  <Card title="Generate Image" icon="image" href="/api-reference/endpoint/create-image">
    `POST /images/generations` — DALL-E 3, Flux, and more
  </Card>

  <Card title="Text to Speech" icon="volume-high" href="/api-reference/endpoint/create-speech">
    `POST /audio/speech` — 6 voices, 5 formats
  </Card>

  <Card title="Transcribe Audio" icon="microphone" href="/api-reference/endpoint/create-transcription">
    `POST /audio/transcriptions` — Whisper, 99 languages
  </Card>

  <Card title="Create Embedding" icon="vector-square" href="/api-reference/endpoint/create-embedding">
    `POST /embeddings` — Vector embeddings for RAG & search
  </Card>
</CardGroup>

## Response Format

Every response follows the OpenAI format:

```json theme={null}
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1715000000,
  "model": "gpt-4o",
  "choices": [...],
  "usage": {
    "prompt_tokens": 28,
    "completion_tokens": 45,
    "total_tokens": 73
  }
}
```

## Error Format

```json theme={null}
{
  "error": {
    "type": "rate_limit_exceeded",
    "message": "Daily request limit reached. Resets at midnight UTC.",
    "code": 429
  }
}
```

See [Error Codes](/reference/errors) for the full list.
