Skip to main content
Use this how-to guide after the quickstart, when you are ready to put Phaseo behind a real application feature. By the end, you should have:
  • a safely stored API key
  • a clear endpoint choice
  • one working request in your app
  • links to the right production guides for routing, SDKs, and operations

Before you begin

Make sure you have the following in place:
  • A Phaseo account with Gateway access.
  • An API key from the dashboard.
  • An HTTP client, OpenAI-compatible SDK, or Phaseo SDK.
  • A supported model ID, such as google/gemma-3-27b:free for a zero-credit start.

1. Store the API key

  1. Open Gateway -> API Keys in the Phaseo dashboard.
  2. Create a key with a name that identifies the app and environment.
  3. Store the value in a secret manager or local environment file:
# .env
PHASEO_API_KEY="phaseo_v1_sk_<kid>_<secret>"
Use separate keys for local development, preview deployments, and production. It makes rotation and usage review much easier.

2. Choose the endpoint

Choose the endpoint that best matches the job you are doing:
EndpointWhen to use it
/v1/responsesNew text builds, structured outputs, and multi-step workflows.
/v1/chat/completionsChat interfaces, assistants, and OpenAI-style integrations.
/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 the app request

Start with the request shape your app is most likely to keep. This example uses Chat Completions because it works well for OpenAI-compatible clients.
curl https://api.phaseo.ai/v1/chat/completions \
  -H "Authorization: Bearer $PHASEO_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." }
    ]
  }'
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.PHASEO_API_KEY,
  baseURL: "https://api.phaseo.ai/v1",
});

const response = await client.chat.completions.create({
  model: "google/gemma-3-27b:free",
  messages: [
    { role: "system", content: "You are a helpful assistant." },
    { role: "user", content: "Explain the benefits of AI." },
  ],
});

console.log(response.choices[0]?.message?.content);
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.phaseo.ai/v1",
)

response = client.chat.completions.create(
    model="google/gemma-3-27b:free",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain the benefits of AI."},
    ],
)

print(response.choices[0].message.content)
package main

import (
  "context"
  "fmt"

  phaseo "github.com/phaseoteam/Phaseo/packages/sdk/sdk-go"
)

func main() {
  client := phaseo.New("YOUR_API_KEY", "https://api.phaseo.ai/v1")

  response, err := client.ChatCompletions(context.Background(), map[string]interface{}{
    "model": "google/gemma-3-27b:free",
    "messages": []map[string]string{
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Explain the benefits of AI."},
    },
  })
  if err != nil {
    panic(err)
  }

  fmt.Println(response)
}
using PhaseoSdk;
using System.Collections.Generic;

var client = new Phaseo("YOUR_API_KEY");

var response = await client.ChatCompletions(new Dictionary<string, object>
{
    ["model"] = "google/gemma-3-27b:free",
    ["messages"] = new object[]
    {
        new Dictionary<string, object> { ["role"] = "system", ["content"] = "You are a helpful assistant." },
        new Dictionary<string, object> { ["role"] = "user", ["content"] = "Explain the benefits of AI." }
    }
});

Console.WriteLine(response);
<?php
require 'vendor/autoload.php';

use Phaseo\Sdk\Phaseo;

$client = new Phaseo(getenv('PHASEO_API_KEY') ?: 'YOUR_API_KEY');

$response = $client->chatCompletions([
    'model' => 'google/gemma-3-27b:free',
    'messages' => [
        ['role' => 'system', 'content' => 'You are a helpful assistant.'],
        ['role' => 'user', 'content' => 'Explain the benefits of AI.'],
    ],
]);

print_r($response);
require 'phaseo_sdk'

client = PhaseoSdk::Phaseo.new(api_key: ENV.fetch('PHASEO_API_KEY', 'YOUR_API_KEY'))

response = client.chat_completions(
  model: 'google/gemma-3-27b:free',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Explain the benefits of AI.' }
  ]
)

puts response

4. Configure environments

Store your API key in environment variables for different environments:
# .env.local
PHASEO_API_KEY="phaseo_v1_sk_<kid>_<secret>"
PHASEO_BASE_URL="https://api.phaseo.ai/v1"
When making requests, send the key in the Authorization header:
Authorization: Bearer $PHASEO_API_KEY

5. Production next steps

Last modified on July 9, 2026