# Kaien API Documentation

Use OpenAI-compatible APIs to connect text, image, video, audio, file, and agent capabilities.

Kaien API provides one API key and an OpenAI-compatible API surface for text, image, video, audio, file, embeddings, reranking, and realtime workloads. Claude and Gemini clients can also connect through their native protocols.

## Recommended reading order

For a new integration:

1. Create or select an API key in the console.
2. Call the model list and confirm the model IDs available to that key.
3. Choose an interface for your workload: text, image, video, audio, or files.
4. Run a minimal request before adding streaming, tools, reference images, or task polling.
5. Review usage and charges in the console.

## Basic information

Production base URL:

```text
https://kaienapi.com
```

Default authentication:

```http
Authorization: Bearer <YOUR_API_KEY>
```

Claude native requests may also use `x-api-key`. Gemini native requests may use `x-goog-api-key` or `?key=`. Use Bearer authentication unless a client requires a native header.

## Handling results

Response shapes depend on the interface:

- Text usually appears in `choices[0].message.content` or the Responses output array.
- Image results may be returned as a URL or base64 data.
- Video and music requests usually create a task first, then return a task ID for polling.
- File APIs have separate upload, retrieve, download, and delete operations.

Save long-lived image, video, and audio results to your own object storage.

## AI-readable documentation

The documentation can be read directly by AI tools:

- [Copy as Markdown](/docs/en/ai/copy-as-markdown) converts a page into Markdown for LLM context.
- [`skill.md`](/docs/en/skill.md) gives agents the integration order and API boundaries.
- [MCP documentation](/docs/en/mcp) describes the current self-hosted deployment boundary.

These entry points are designed for Codex, Claude Code, Cursor, OpenCode, n8n, and other tools that can read Markdown or web pages.
