---
name: apisea
description: Call 250+ AI models (OpenAI, Anthropic, Google, xAI, DeepSeek, ByteDance and more) through one OpenAI-compatible APISea key. Use when the user wants to chat with another model, compare models, generate or edit images, create video or music, or look up which models and prices are available.
---

# APISea

APISea is an OpenAI-compatible gateway: one API key and one base URL for 250+ chat, image, video and audio models.

- Base URL: `https://api.apisea.ai/v1`
- Auth: `Authorization: Bearer $APISEA_API_KEY` (keys start with `sk-sea-`; create one at https://apisea.ai/console/keys)
- Machine-readable docs: https://apisea.ai/llms.txt (links every model page and API reference page)
- Prefer tools over curl? APISea also runs a remote MCP server at `https://api.apisea.ai/mcp` (same key, `Authorization: Bearer` header). See https://apisea.ai/agent-tools

## Rules

1. Read the key from the environment variable `APISEA_API_KEY`. Never print it, hard-code it, write it to a file or commit it. If it is not set, ask the user to set it and stop.
2. Calls to chat, image, video and music models are billed to the user's prepaid balance. Before generating images, video or music, tell the user which model you will use and roughly what it costs (the model page on apisea.ai shows the price) and wait for a go-ahead, unless they already approved spending. Use the cheapest suitable model for tests.
3. Use exact model ids. List models first instead of guessing.
4. Parameters differ per model. Before the first call to an image, video or music model, read its page (linked from llms.txt) for the accepted parameters.

## List models

```bash
curl -s https://api.apisea.ai/v1/models -H "Authorization: Bearer $APISEA_API_KEY"
```

## Chat (OpenAI format)

```bash
curl -s https://api.apisea.ai/v1/chat/completions \
  -H "Authorization: Bearer $APISEA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"<chat-model-id>","messages":[{"role":"user","content":"Hello"}],"max_tokens":300}'
```

The official OpenAI SDKs work too: set `base_url` to `https://api.apisea.ai/v1` and `api_key` to the key.

## Images, video and music (asynchronous)

Submit a job. The reply contains a task id:

```bash
curl -s https://api.apisea.ai/v1/images/generations \
  -H "Authorization: Bearer $APISEA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"<image-model-id>","prompt":"a small red apple on a white table"}'
# {"code":200,"data":[{"status":"submitted","task_id":"task_..."}]}
```

Endpoints: `images/generations` (or the model's edit endpoint) for images, `videos/generations` for video, `music/generations` for music. Use the endpoint and body shown on the model's page.

Poll until `data.status` is `completed` or `failed` (every 3-5 seconds for images, every 10 seconds for video and music):

```bash
curl -s https://api.apisea.ai/v1/tasks/<task_id> -H "Authorization: Bearer $APISEA_API_KEY"
# music tasks: https://api.apisea.ai/v1/music/tasks/<task_id>
```

When completed, the result links are in `data.result` (for example `result.images[].url`). Links expire after about 72 hours, so download anything the user wants to keep. Failed jobs are refunded automatically.

## Errors

- `401` invalid or expired key.
- `402` insufficient balance: tell the user to top up at https://apisea.ai/console/billing.
- `403` the key is not allowed to use that model or IP.
- `429` the key's spending limit or the rate limit was reached; wait or ask the user to raise the limit.
