≡ All docs
API Guide / Quickstart
Quickstart
Updated: 2026-05-11
Make your first API call in 5 minutes. If you hit any issues, open a ticket on the contact page anytime.
1. Get an API Key
Sign in to the console → API Key → click "Create Key", and store the returned plaintext key safely (shown only once).
2. Make Your First Request
Add the header Authorization: Bearer YOUR_API_KEY and POST to /chat/completions.
cURL
curl -X POST "https://www.starunion.net/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seed-2-0-lite-260215",
"messages": [{"role": "user", "content": "Hello"}]
}'3. Read the Response
The server returns an OpenAI-compatible JSON response:
JSON
{"id": "chatcmpl-7xN3f2k...","object": "chat.completion","model": "doubao-seed-2-0-lite-260215","choices": [{"index": 0,"message": {"role": "assistant","content": "Hello! How can I help you?"},"finish_reason": "stop"}],"usage": {"prompt_tokens": 9,"completion_tokens": 12,"total_tokens": 21}}
Didn't find what you were looking for?Contact us →