> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# Agent SDK installation

> Install the Phaseo Agent SDK and set the API key its gateway client uses.

Install your language's Agent SDK package, set `PHASEO_API_KEY`, and build a first agent in [Usage](https://phaseo.app/docs/v1/sdk-reference/agent/usage.md). Each package brings its language's core Phaseo client with it as a dependency.

**1. Install the package**

> [tab] TypeScript
>
> Install [`@phaseo/agent-sdk`](https://www.npmjs.com/package/@phaseo/agent-sdk) 0.3.0 into a TypeScript or JavaScript project. `@phaseo/sdk` comes with it.
>
> ```bash npm theme={null}
> npm install @phaseo/agent-sdk
> ```
>
> ```bash pnpm theme={null}
> pnpm add @phaseo/agent-sdk
> ```
>
> ```bash yarn theme={null}
> yarn add @phaseo/agent-sdk
> ```
>
> ```bash bun theme={null}
> bun add @phaseo/agent-sdk
> ```

> [tab] Python
>
> Install [`phaseo-agent-sdk`](https://pypi.org/project/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.
>
> ```bash pip theme={null}
> pip install phaseo-agent-sdk
> ```
>
> ```bash uv theme={null}
> uv add phaseo-agent-sdk
> ```

> [tab] Go
>
> Add [`agent-sdk-go`](https://pkg.go.dev/github.com/phaseoteam/Phaseo/packages/sdk/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.
>
> ```bash theme={null}
> go get github.com/phaseoteam/Phaseo/packages/sdk/agent-sdk-go@latest
> ```
>
> Import the agent package as `phaseoagent`:
>
> ```go theme={null}
> import phaseoagent "github.com/phaseoteam/Phaseo/packages/sdk/agent-sdk-go"
> ```

> [tab] C#
>
> Add [`Phaseo.AgentSdk`](https://www.nuget.org/packages/Phaseo.AgentSdk) 0.3.0 from NuGet. You need .NET 8 or newer. NuGet adds `Phaseo.Sdk` as a dependency.
>
> ```bash theme={null}
> dotnet add package Phaseo.AgentSdk
> ```
>
> The agent types are in the `PhaseoAgentSdk` namespace:
>
> ```csharp theme={null}
> using PhaseoAgentSdk;
> ```

> [tab] PHP
>
> Add [`phaseo/agent-sdk`](https://packagist.org/packages/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.
>
> ```bash theme={null}
> composer require phaseo/agent-sdk
> ```
>
> The agent classes are in the `Phaseo\AgentSdk` namespace:
>
> ```php theme={null}
> use Phaseo\AgentSdk\AgentDefinition;
> use Phaseo\AgentSdk\AgentSdk;
> use Phaseo\AgentSdk\Tool;
> ```

> [tab] Ruby
>
> Add [`phaseo_agent_sdk`](https://rubygems.org/gems/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.
>
> ```bash gem theme={null}
> gem install phaseo_agent_sdk
> ```
>
> ```ruby Gemfile theme={null}
> gem "phaseo_agent_sdk"
> ```
>
> Load the agent module with:
>
> ```ruby theme={null}
> require "phaseo_agent_sdk"
> ```

> [tab] Java
>
> Add `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`.
>
> ```xml Maven theme={null}
> <dependency>
>   <groupId>app.phaseo</groupId>
>   <artifactId>phaseo-agent-sdk</artifactId>
>   <version>0.3.0</version>
> </dependency>
> ```
>
> ```kotlin Gradle theme={null}
> implementation("app.phaseo:phaseo-agent-sdk:0.3.0")
> ```
>
> To build from source instead:
>
> ```bash theme={null}
> git clone https://github.com/phaseoteam/Phaseo.git
> cd Phaseo
> mvn -f packages/sdk/agent-sdk-java/pom.xml package
> ```

> [tab] Rust
>
> Add [`phaseo-agent`](https://crates.io/crates/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.
>
> ```toml Cargo.toml theme={null}
> [dependencies]
> phaseo = "0.2"
> phaseo-agent = "0.2"
> serde_json = "1"
> ```
>
> ```bash cargo theme={null}
> cargo add phaseo@0.2 phaseo-agent@0.2 serde_json
> ```

**2. Set your API key**

Create a key in [API Keys](https://phaseo.app/settings/keys), then export it:

```bash macOS and Linux theme={null}
export PHASEO_API_KEY="phaseo_v1_sk_..."
```

```powershell Windows theme={null}
$env:PHASEO_API_KEY = "phaseo_v1_sk_..."
```

Most gateway clients read the key from the environment; Python's doesn't. TypeScript, Python, and Java ignore `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)` |

The default base URL is `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:

```typescript TypeScript theme={null}
import { createAgent } from "@phaseo/agent-sdk";

createAgent({ id: "verification-agent", model: "openai/gpt-6-astra" });
console.log("Phaseo Agent SDK installed");
```

```python Python theme={null}
from phaseo_agent import create_agent

create_agent({"id": "verification-agent", "model": "openai/gpt-6-astra"})
print("Phaseo Agent SDK installed")
```

```go Go theme={null}
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")
}
```

```csharp C# theme={null}
using PhaseoAgentSdk;

AgentSdk.CreateAgent(new AgentDefinition { Id = "verification-agent", Model = "openai/gpt-6-astra" });
Console.WriteLine("Phaseo Agent SDK installed");
```

```php PHP theme={null}
<?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;
```

```ruby Ruby theme={null}
require "phaseo_agent_sdk"

PhaseoAgentSdk.create_agent(id: "verification-agent", model: "openai/gpt-6-astra")
puts "Phaseo Agent SDK installed"
```

```rust Rust theme={null}
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");
}
```

Java has no short form: `AgentDefinition` is a positional record, shown in full in [Usage](https://phaseo.app/docs/v1/sdk-reference/agent/usage.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.