Skip to main content
Use this guide when you are ready to move from a first successful request to a real application integration. By the end, you should have:
  • a safely stored API key
  • a clear endpoint choice
  • one working request in your app
  • the right next pages for routing, SDKs, and production rollout

Before you begin

Make sure you have the following in place:
  • An AI Stats account with Gateway access.
  • At least one API key generated from your dashboard.
  • An HTTP client or SDK.
  • A model ID supported by the Gateway, such as google/gemma-3-27b:free for a zero-deposit start.

1. Create and store an API key

  1. Log in to the AI Stats dashboard.
  2. Navigate to Gateway -> API Keys.
  3. Create a new key, give it a descriptive name, and copy the generated value.
  4. Store the key securely using your secret manager or environment variables:
# .env
AI_STATS_API_KEY="aistats_v1_sk_<kid>_<secret>"
Tip Rotate keys regularly and remove any that are no longer needed. This keeps access scoped and auditable.

2. Choose an endpoint and model

Choose the endpoint that best matches the job you are doing:
EndpointWhen to use it
/v1/chat/completionsChat interfaces, assistants, and OpenAI-style integrations.
/v1/responsesNew builds, structured outputs, and multi-step text workflows.
/v1/messagesAnthropic-compatible integrations.
/v1/moderationsSafety and content policy checks.
/v1/images/generationsImage generation from text prompts.
Refer to the API Reference for the complete list of supported parameters and responses.
Free-model IDs end with :free and can be called without depositing credits. Paid-model calls require available wallet balance.

3. Send a request

Start with one successful chat request through the integration path you plan to keep.
curl https://api.phaseo.app/v1/chat/completions \
  -H "Authorization: Bearer $AI_STATS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemma-3-27b:free",
    "messages": [
      { "role": "system", "content": "You are a helpful assistant." },
      { "role": "user", "content": "Explain the benefits of AI." }
    ]
  }'

4. Configure environments

Store your API key in environment variables for different environments:
# .env.local
AI_STATS_API_KEY="aistats_v1_sk_<kid>_<secret>"
AI_STATS_BASE_URL="https://api.phaseo.app/v1"
When making requests, always include the Authorization header with your API key:
Authorization: Bearer $AI_STATS_API_KEY

5. Next steps

Last modified on May 19, 2026