빠른 시작

빠른 시작

Call multiple models with one key through OpenAI- and Anthropic-compatible APIs. This page covers authentication, streaming, model selection and error handling.

OpenAI SDK · Anthropic SDK · cURL 호환

1단계 — 가입 및 무료 크레딧 받기

2단계 — API 키 생성

3단계 — 베이스 URL 설정

OpenAI 호환 베이스 URL https://aaa.ashp.tw/v1
Anthropic 호환 베이스 URL https://aaa.ashp.tw/v1/anthropic

4단계 — 첫 요청 보내기

cURL curl https://aaa.ashp.tw/v1/chat/completions \ -H "Authorization: Bearer $AAA_TOKEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "messages": [{"role": "user", "content": "Hello!"}] }'

본인의 API 키(sk- 로 시작)를 Bearer 토큰으로 Authorization 헤더에 넣어 전송하세요.

API 키 발급받기 예제 →

API reference

Authentication

Every request must include your API key (it starts with sk-). On OpenAI-compatible endpoints, send it in the Authorization: Bearer header; on Anthropic-compatible endpoints you can also use the x-api-key header. Keep your key secret and never put it in client-side code or public repositories.

HTTP Header Authorization: Bearer $AAA_TOKEN_API_KEY

Streaming

Add stream: true to your request to receive output incrementally over Server-Sent Events (SSE), which suits chat interfaces and long responses. Streaming is supported on both the OpenAI-compatible /v1/chat/completions and the Anthropic-compatible /v1/messages.

Models and pricing

Set the model field of your request to a model name, such as claude-sonnet-4-6 or gpt-5.4. See the pricing page for available models and their per-million-token prices.

가격 보기 →

Error codes

HTTPType
401The API key is missing, invalid or has been revoked. Check that your key is correct.
402Insufficient balance. Top up your account and try again.
404The requested path or model was not found. Check the base URL, the path and the model name.
429Too many requests: a rate limit was hit. Wait a moment and retry with exponential backoff.
500+A temporary error or timeout occurred at the upstream model provider. Retry shortly; if it persists, contact [email protected].

Video generation API (Seedance)

Generate AI video with the same API key. Creating a task returns a task ID immediately; poll it with GET until it returns the video URL. The native Ark path /v1/contents/generations/tasks is also supported.

Create a video task curl https://aaa.ashp.tw/v1/videos/generations \ -H "Authorization: Bearer $AAA_TOKEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-1-5-pro-251215", "content": [{"type": "text", "text": "A golden dragon flying over a neon city at night"}], "resolution": "720p", "duration": 5, "ratio": "16:9" }'
Poll the task (every ~5 seconds) curl https://aaa.ashp.tw/v1/videos/generations/vid_xxxxxxxxxxxxxxxxxxxxxxxx \ -H "Authorization: Bearer $AAA_TOKEN_API_KEY"

Billing: you are charged only when the video succeeds — cost = video tokens × model price, where video tokens ≈ width × height × fps × seconds ÷ 1024. Failed or cancelled tasks are free. Video URLs expire after about 24 hours, so download promptly.

Per-key limits

Each API key can have its own total and daily spend caps, model allowlist, IP allowlist, expiry and requests-per-minute limit, set in your dashboard — so you can safely hand keys to teammates, clients or servers. When a limit is hit you get:

HTTPType
401key_expired — the key has expired
402key_spend_limit — the key reached its total spend cap
403model_not_allowed / ip_not_allowed — the model or source IP is not on the key’s allowlist
429key_daily_limit / key_rate_limit — the daily spend cap or per-minute limit was reached

Set key limits →

Model list

GET /v1/models returns every model currently available (OpenAI format), ready for tools like Cursor and Cline.

GET curl https://aaa.ashp.tw/v1/models -H "Authorization: Bearer $AAA_TOKEN_API_KEY"

More resources

가입하고 $1 무료 크레딧 받기