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

# API reference

> Fundamentals and routing overview for the unified DimiLinks API.

## Base URL

Choose the domain for the protocol family you use. Both domains share the same Bearer key:

| Protocol family   | Base URL                            | Primary routes                                                          |
| ----------------- | ----------------------------------- | ----------------------------------------------------------------------- |
| OpenAI-compatible | `https://dimilinks.com/v1`          | `/chat/completions`, `/models`, `/images/*`, `/videos/*`, `/tasks/{id}` |
| Native Anthropic  | `https://api-direct.dimilinks.com/` | `/v1/messages`                                                          |

See [Authentication](/en/api-reference/authentication) for details.

## Route overview

| Method | Full URL                                            | Description                                                                                            |
| ------ | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `GET`  | `https://dimilinks.com/v1/models`                   | List the models available to the current key                                                           |
| `POST` | `https://dimilinks.com/v1/chat/completions`         | OpenAI-compatible chat for GPT; also supports Claude and other text models through the OpenAI protocol |
| `POST` | `https://api-direct.dimilinks.com/v1/messages`      | Native Anthropic protocol; recommended for the Claude SDK and Claude Code                              |
| `POST` | `https://dimilinks.com/v1/images/generations`       | Text-to-image generation with JSON reference-image extensions                                          |
| `POST` | `https://dimilinks.com/v1/images/edits`             | Multipart image-to-image generation and editing                                                        |
| `POST` | `https://dimilinks.com/v1/videos/generations`       | Text-to-video and reference-image-to-video generation                                                  |
| `GET`  | `https://dimilinks.com/v1/tasks/{task_id}`          | Shared image and video task retrieval                                                                  |
| `GET`  | `https://dimilinks.com/v1/videos/{task_id}/content` | Direct video task result (authentication required)                                                     |
| `GET`  | `https://dimilinks.com/p/img/{task_id}/{idx}`       | Signed image URL (no Bearer token required; the signature is embedded in the URL)                      |

## Protocol conventions

* Text chat: compatible with the official OpenAI and Anthropic SDKs; point the SDK's base URL to DimiLinks.
* Images: responses follow OpenAI Images conventions. `data[].url` may be a relative path, an HTTPS URL, or a Data URL.
* Videos: asynchronous by default. Submission returns a `task_id` immediately; poll `/v1/tasks/{task_id}` for progress.

## Recommended asynchronous workflow

```text theme={null}
POST https://dimilinks.com/v1/images/generations?async=true   # Submit an image task
POST https://dimilinks.com/v1/videos/generations              # Submit a video task (always asynchronous)
GET  https://dimilinks.com/v1/tasks/{task_id}                 # Shared task retrieval
```

Image and video generation times vary. The asynchronous workflow avoids long-lived connections, gateway timeouts, and tasks being lost when a page closes.
