Skip to main content
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

  1. Open the AI Stats Dashboard.
  2. Create a key under Gateway -> Keys.
  3. 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. Start with a free model (no deposit required)

Use POST /v1/responses for the fastest first success.
Requests to :free models do not require deposited credits. Paid models still require available wallet balance.

Request (request format)

curl https://api.phaseo.app/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemma-3-27b:free",
    "input": "Reply with: quickstart works",
    "temperature": 0
  }'

Response (response format)

{
  "id": "resp_...",
  "object": "response",
  "created_at": 1730000000,
  "status": "completed",
  "completed_at": 1730000001,
  "model": "google/gemma-3-27b:free",
  "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.
  • 402: paid model without sufficient balance. Use a :free model or top up credits.
  • 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.
  1. Create a job with POST /v1/videos.
  2. Poll status with GET /v1/videos/{video_id} until completed.
  3. 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

Integrating with the Gateway

Production integration patterns and endpoint selection.

API Reference

Full request and response docs for every endpoint.

Examples

More complete request samples for common workflows.

Support

Get help with debugging, routing, and model behavior.
Last modified on April 15, 2026