PHASEO_API_KEY, and build a first agent in Usage. Each package brings its language’s core Phaseo client with it as a dependency.
1
Install the package
- TypeScript
- Python
- Go
- C#
- PHP
- Ruby
- Java
- Rust
Install
@phaseo/agent-sdk 0.3.0 into a TypeScript or JavaScript project. @phaseo/sdk comes with it.npm install @phaseo/agent-sdk
pnpm add @phaseo/agent-sdk
yarn add @phaseo/agent-sdk
bun add @phaseo/agent-sdk
Install
phaseo-agent-sdk 0.3.0 into a Python 3.10 or newer environment. The core phaseo client (3.x) comes with it, and the package installs as the phaseo_agent module.pip install phaseo-agent-sdk
uv add phaseo-agent-sdk
Add Import the agent package as
agent-sdk-go v0.3.0 with Go 1.24 or newer. Go adds the core client, github.com/phaseoteam/Phaseo/packages/sdk/sdk-go/v3, as a dependency.go get github.com/phaseoteam/Phaseo/packages/sdk/agent-sdk-go@latest
phaseoagent:import phaseoagent "github.com/phaseoteam/Phaseo/packages/sdk/agent-sdk-go"
Add The agent types are in the
Phaseo.AgentSdk 0.3.0 from NuGet. You need .NET 8 or newer. NuGet adds Phaseo.Sdk as a dependency.dotnet add package Phaseo.AgentSdk
PhaseoAgentSdk namespace:using PhaseoAgentSdk;
Add The agent classes are in the
phaseo/agent-sdk v0.3.0 with Composer. You need PHP 8.1 or newer. Composer adds phaseo/sdk (^3.0.0) as a dependency.composer require phaseo/agent-sdk
Phaseo\AgentSdk namespace:use Phaseo\AgentSdk\AgentDefinition;
use Phaseo\AgentSdk\AgentSdk;
use Phaseo\AgentSdk\Tool;
Add Load the agent module with:
phaseo_agent_sdk 0.3.0 with RubyGems or Bundler. You need Ruby 3.2 or newer. RubyGems adds phaseo_sdk (>= 3.0.0, < 4.0.0) as a dependency.gem install phaseo_agent_sdk
gem "phaseo_agent_sdk"
require "phaseo_agent_sdk"
Add To build from source instead:
app.phaseo:phaseo-agent-sdk 0.3.0 from Maven Central. You need Java 17 or newer. The build adds app.phaseo:phaseo-sdk 3.0.0 and Jackson as dependencies. All types are nested records in app.phaseo.agent.AgentSdk.<dependency>
<groupId>app.phaseo</groupId>
<artifactId>phaseo-agent-sdk</artifactId>
<version>0.3.0</version>
</dependency>
implementation("app.phaseo:phaseo-agent-sdk:0.3.0")
git clone https://github.com/phaseoteam/Phaseo.git
cd Phaseo
mvn -f packages/sdk/agent-sdk-java/pom.xml package
Add
phaseo-agent and the phaseo client, both at 0.2.0 on crates.io, with Rust 1.86 or newer. Unlike the other languages, add the core client yourself.[dependencies]
phaseo = "0.2"
phaseo-agent = "0.2"
serde_json = "1"
cargo add phaseo@0.2 phaseo-agent@0.2 serde_json
2
Set your API key
Create a key in API Keys, then export it:Most gateway clients read the key from the environment; Python’s doesn’t. TypeScript, Python, and Java ignore
The default base URL is
export PHASEO_API_KEY="phaseo_v1_sk_..."
$env:PHASEO_API_KEY = "phaseo_v1_sk_..."
PHASEO_BASE_URL:| Language | Gateway client | Reads PHASEO_API_KEY | Reads PHASEO_BASE_URL | Pass them in code with |
|---|---|---|---|---|
| TypeScript | createGatewayAgentClient() | Yes | No | clientOptions.apiKey, clientOptions.baseUrl |
| Python | create_gateway_agent_client() | No; raises ValueError without a key | No | client_options={"api_key": ...} or client=Phaseo() |
| Go | CreateGatewayAgentClient(...) | Yes, when APIKey is empty | Yes, when BaseURL is empty | GatewayAgentClientOptions.APIKey, .BaseURL |
| C# | AgentSdk.CreateGatewayAgentClient() | Yes | Yes | apiKey, baseUrl in GatewayAgentClientOptions.ClientOptions |
| PHP | AgentSdk::createGatewayAgentClient() | Yes | Yes | api_key, base_url in GatewayAgentClientOptions::$clientOptions |
| Ruby | PhaseoAgentSdk.create_gateway_agent_client | Yes | Yes | api_key:, base_url: |
| Java | AgentSdk.createGatewayAgentClient() | Yes | No | new AgentSdk.GatewayOptions(null, apiKey, baseUrl, null, null, null) |
| Rust | create_gateway_agent_client(model), GatewayAgentClient::from_env(model) | Yes | Yes, through the phaseo client | GatewayAgentClient::new(client, model) |
https://api.phaseo.app/v1.3
Check the install
Build an agent without calling the model. If this compiles and runs, the package is installed:Java has no short form:
import { createAgent } from "@phaseo/agent-sdk";
createAgent({ id: "verification-agent", model: "openai/gpt-6-astra" });
console.log("Phaseo Agent SDK installed");
from phaseo_agent import create_agent
create_agent({"id": "verification-agent", "model": "openai/gpt-6-astra"})
print("Phaseo Agent SDK installed")
package main
import (
"fmt"
phaseoagent "github.com/phaseoteam/Phaseo/packages/sdk/agent-sdk-go"
)
func main() {
phaseoagent.CreateAgent(phaseoagent.AgentDefinition{ID: "verification-agent", Model: "openai/gpt-6-astra"})
fmt.Println("Phaseo Agent SDK installed")
}
using PhaseoAgentSdk;
AgentSdk.CreateAgent(new AgentDefinition { Id = "verification-agent", Model = "openai/gpt-6-astra" });
Console.WriteLine("Phaseo Agent SDK installed");
<?php
require "vendor/autoload.php";
use Phaseo\AgentSdk\AgentDefinition;
use Phaseo\AgentSdk\AgentSdk;
AgentSdk::createAgent(new AgentDefinition(id: "verification-agent", model: "openai/gpt-6-astra"));
echo "Phaseo Agent SDK installed" . PHP_EOL;
require "phaseo_agent_sdk"
PhaseoAgentSdk.create_agent(id: "verification-agent", model: "openai/gpt-6-astra")
puts "Phaseo Agent SDK installed"
use phaseo_agent::{create_agent, AgentDefinition};
fn main() {
let _agent = create_agent(AgentDefinition::new(
"verification-agent",
"openai/gpt-6-astra",
));
println!("Phaseo Rust Agent SDK installed");
}
AgentDefinition is a positional record, shown in full in Usage.