This guide is intentionally short. Follow it in order and you should have a working integration in a few minutes.
1. Create an API key
- Open the AI Stats Dashboard.
- Create a key under Gateway -> Keys.
- Copy it once and store it securely.
Use this format:
Authorization: Bearer aistats_v1_sk_<kid>_<secret>
Treat your API key like a password. Do not expose it in client-side code.
2. Send your first request
Use POST /v1/responses for the fastest first success.
curl https://api.phaseo.app/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5-nano",
"input": "Reply with: quickstart works",
"temperature": 0
}'
{
"id": "resp_...",
"object": "response",
"created_at": 1730000000,
"status": "completed",
"completed_at": 1730000001,
"model": "openai/gpt-5-nano",
"output": [
{
"type": "message",
"id": "msg_...",
"status": "completed",
"role": "assistant",
"content": [{ "type": "output_text", "text": "quickstart works", "annotations": [] }]
}
],
"usage": {
"input_tokens": 9,
"output_tokens": 3,
"total_tokens": 12
},
"error": null,
"incomplete_details": null
}
For Responses API calls, read assistant text from output[].content[] where type is output_text.
For Vercel AI SDK calls, use result.text.
3. If it fails, check these first
401: key format or header issue.
400: request body shape or unsupported parameter.
429/5xx: retry with backoff.
Use the Error Handling reference to debug quickly.
4. Video jobs are asynchronous
Video creation is long-running by design.
- Create a job with
POST /v1/videos.
- Poll status with
GET /v1/videos/{video_id} until completed.
- Download content from
GET /v1/videos/{video_id}/content.
# Create
curl https://api.phaseo.app/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<video-model-id>",
"prompt": "A cinematic sunrise over a mountain lake"
}'
# Poll status
curl https://api.phaseo.app/v1/videos/VIDEO_ID \
-H "Authorization: Bearer YOUR_API_KEY"
5. Next steps