Use this page when you already understand the basics and want working examples to copy into your app.
You can use it for:
- small request examples
- runnable sample projects
- cookbook walkthroughs that explain the project structure
Examples marked with :free do not require deposited credits.
Free text generation
Use this example for the fastest zero-credit smoke test with the Responses API.
curl https://api.phaseo.ai/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemma-3-27b:free",
"input": "Summarize this article in 3 bullet points."
}'
import Phaseo from "@phaseo/sdk";
const client = new Phaseo({ apiKey: process.env.PHASEO_API_KEY! });
const response = await client.generateResponse({
model: "google/gemma-3-27b:free",
input: "Summarize this article in 3 bullet points.",
});
console.log(response.output_text);
from phaseo import Phaseo
client = Phaseo(api_key="YOUR_API_KEY")
response = client.generate_response(
{
"model": "google/gemma-3-27b:free",
"input": "Summarize this article in 3 bullet points.",
}
)
print(response.get("output_text"))
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")
input := map[string]interface{}{
"role": "user",
"content": []map[string]interface{}{
{
"type": "input_text",
"text": "Summarize this article in 3 bullet points.",
},
},
}
response, err := client.GenerateResponse(context.Background(), phaseo.ResponsesRequest{
Model: "google/gemma-3-27b:free",
Input: &input,
})
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.GenerateResponse(new Dictionary<string, object>
{
["model"] = "google/gemma-3-27b:free",
["input"] = "Summarize this article in 3 bullet points."
});
Console.WriteLine(response);
<?php
require 'vendor/autoload.php';
use Phaseo\Sdk\Phaseo;
$client = new Phaseo(getenv('PHASEO_API_KEY') ?: 'YOUR_API_KEY');
$response = $client->generateResponse([
'model' => 'google/gemma-3-27b:free',
'input' => 'Summarize this article in 3 bullet points.',
]);
print_r($response);
require 'phaseo_sdk'
client = PhaseoSdk::Phaseo.new(api_key: ENV.fetch('PHASEO_API_KEY', 'YOUR_API_KEY'))
response = client.generate_response(
model: 'google/gemma-3-27b:free',
input: 'Summarize this article in 3 bullet points.'
)
puts response
import ai.stats.sdk.Phaseo;
Phaseo client = new Phaseo(System.getenv("PHASEO_API_KEY"));
String body = """
{
"model": "google/gemma-3-27b:free",
"input": [
{
"role": "user",
"content": [
{ "type": "input_text", "text": "Summarize this article in 3 bullet points." }
]
}
]
}
""";
Object response = client.createResponse(body);
System.out.println(String.valueOf(response));
Paid chat completion
Use this when you want an OpenAI-compatible chat request against a paid model.
curl https://api.phaseo.ai/v1/chat/completions \
-H "Authorization: Bearer $PHASEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.4",
"messages": [{"role": "user", "content": "Write a short email."}]
}'
Image generation
Use this when your app needs a generated image from a prompt.
curl https://api.phaseo.ai/v1/images/generations \
-H "Authorization: Bearer $PHASEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-1",
"prompt": "A minimal line drawing of a lighthouse."
}'
Runnable sample projects
Each sample project has a matching cookbook walkthrough.
Browser apps
Script and backend starters
Prompt-first starters
If you want a coding agent to generate the first version for you, start here:
More SDK examples
Explore the SDK Reference for language-specific examples.