User Guide

Get started in three minutes: Obtain an API Key → Make your first request

Step 1: Obtain an API Key

Visit the API Key Management page to create a key (starting with sk-). All requests are authenticated through the HTTP header:

Authorization: Bearer YOUR_API_KEY

Step 2: Start a Text Conversation

The platform is fully compatible with the OpenAI protocol. Change the Base URL to https://api.maitoken.net/v1 to use your existing SDK:

curl -X POST https://api.maitoken.net/v1/chat/completions \  -H "Authorization: Bearer YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-5.6-sol",    "messages": [{ "role": "user", "content": "Hello, introduce yourself" }]  }'

Available models are determined by the response from List Models. The native Anthropic / Gemini protocols are also supported. See the Messages API.

Generate Images (Synchronous)

Image generation is a synchronous interface. The response directly returns the image, with no polling required (the connection remains open during generation; a client timeout of ≥ 180 seconds is recommended):

curl -X POST https://api.maitoken.net/v1/images/generations \  -H "Authorization: Bearer YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-image-1",    "prompt": "A cyberpunk cityscape at night, neon lights after the rain",    "size": "1024x1024"  }'

See Image Generation for details.

Generate Videos (Asynchronous)

Video generation is an asynchronous interface: submitting a request returns a task ID; poll until a terminal status is reached, then retrieve the result. Using Sora as an example:

# 1. Submitcurl -X POST https://api.maitoken.net/v1/videos \  -H "Authorization: Bearer YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{ "model": "sora-2", "prompt": "Sunset by the sea, waves crashing against the rocks", "seconds": "8" }' # 2. Poll (every 5–10 seconds until status=completed)curl https://api.maitoken.net/v1/videos/{video_id} \  -H "Authorization: Bearer YOUR_API_KEY" # 3. Downloadcurl https://api.maitoken.net/v1/videos/{video_id}/content \  -H "Authorization: Bearer YOUR_API_KEY" --output video.mp4

The submission endpoints and request bodies differ across video providers (all use the providers' native protocols): Sora / Kling / Seedance.

Next Steps