# Quick Start > Call text, image, and video models through ToAPIs **Note:** **Note for users in mainland China:** Please use `https://toapis.cn` as the API endpoint (Base URL). Replace `https://toapis.com` with `https://toapis.cn` in the examples in this document. ToAPIs provides OpenAI-compatible text endpoints plus unified asynchronous image and video generation APIs. This guide uses currently available models for your first requests. ## Step 1: Get an API Key 1. Open the [API Key Management page](https://toapis.com/dashboard/tokens) 2. Sign in and create an API key 3. Save it securely when shown; it is displayed only once ## Step 2: Choose a Model | Type | Suggested starter model | Description | | --- | --- | --- | | Text | `gpt-5.6-terra` | Balanced performance and cost for chat and agent workflows | | Image | `gpt-image-2` | Text-to-image and reference-image generation | | Video | `seedance-2` | Text-to-video, first/last-frame image-to-video, and multimodal references | Use the [model list endpoint](/docs/en/api-reference/chat/list-models) and individual model pages as the source of truth for availability. ## Step 3: Send Requests ### Text generation ```bash curl --request POST \ --url https://toapis.com/v1/chat/completions \ --header "Authorization: Bearer YOUR_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "model": "gpt-5.6-terra", "messages": [ {"role": "user", "content": "Hello, please introduce yourself"} ] }' ``` ### Image generation ```bash curl --request POST \ --url https://toapis.com/v1/images/generations \ --header "Authorization: Bearer YOUR_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "model": "gpt-image-2", "prompt": "A cute panda with cinematic lighting", "size": "1:1", "resolution": "1k", "n": 1 }' ``` ### Video generation ```bash curl --request POST \ --url https://toapis.com/v1/videos/generations \ --header "Authorization: Bearer YOUR_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "model": "seedance-2", "prompt": "Waves crashing against the shore, cinematic camera movement", "duration": 5, "aspect_ratio": "16:9", "resolution": "720p" }' ``` ## Step 4: Check Asynchronous Tasks Text requests return directly. Image and video requests return a task ID; use the matching endpoint to retrieve the result: ```bash # Image task curl https://toapis.com/v1/images/generations/YOUR_TASK_ID \ -H "Authorization: Bearer YOUR_API_KEY" # Video task curl https://toapis.com/v1/videos/generations/YOUR_TASK_ID \ -H "Authorization: Bearer YOUR_API_KEY" ``` ## Configure Task Webhooks Set the Token's default HTTPS callback URL and generate a signing secret. A task may include a same-origin `callback_url`. Verify `X-ToAPIs-Webhook-*` against the raw body with HMAC-SHA256, deduplicate by event ID, and keep polling only as a fallback. On `429`, honor `Retry-After`. See [Task Webhooks](/docs/en/api-reference/webhooks/task-webhooks). ## What's Next ### View API docs [View API docs](/docs/en) Browse all endpoints, models, and parameters. ### Claude Code Integration [Claude Code Integration](/docs/en/integrations/claude-code) Use ToAPIs with Claude Code. ### Codex Integration [Codex Integration](/docs/en/integrations/codex) Use ToAPIs with Codex through CC Switch. ### MCP [MCP](/docs/en/integrations/mcp) Generate images and videos from your AI agent through MCP.