> ## 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.

# DevTools

> Record each agent run and continuation to a local file while you develop.

Pass a DevTools config to a run or continuation during development to append one JSON line per run to `generations.jsonl` in a local directory. Each line holds the run's input, steps, tool activity, output, usage and gateway request IDs. Nothing is captured unless you turn it on.

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

const result = await agent.run({
  input,
  client,
  devtools: createAgentDevtools(),
});
```

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

result = agent.run(input="Summarise this ticket", client=client, devtools=create_agent_devtools())
```

```go Go theme={null}
result, err := agent.Run(ctx, phaseoagent.RunOptions{
  Input:    prompt,
  Client:   client,
  Devtools: phaseoagent.CreateAgentDevtools(".phaseo-devtools"),
})
```

```csharp C# theme={null}
var result = await agent.Run(new RunOptions
{
    Input = prompt,
    Client = client,
    Devtools = AgentSdk.CreateAgentDevtools(".phaseo-devtools"),
});
```

```php PHP theme={null}
$result = $agent->run(
    input: $prompt,
    client: $client,
    devtools: AgentSdk::createAgentDevtools(".phaseo-devtools")
);
```

```ruby Ruby theme={null}
result = agent.run(
  input: prompt,
  client: client,
  devtools: PhaseoAgentSdk.create_agent_devtools(directory: ".phaseo-devtools")
)
```

```java Java theme={null}
var result = agent.run(new AgentSdk.RunOptions(
    prompt, client, null, null, null, null, null, null, null,
    AgentSdk.createAgentDevtools(".phaseo-devtools")));
```

> [!NOTE]
>
> Rust `0.2` has no DevTools capture. Use [lifecycle hooks](https://phaseo.app/docs/v1/sdk-reference/agent/lifecycle-hooks.md) with `run_with_events` and write the events yourself.

| Language | Create a config | Pass it as | Choose the directory |
| - | - | - | - |
| TypeScript | `createAgentDevtools()` | `devtools` on run and continue options | `createAgentDevtools({ directory: ".local/agent-runs" })` |
| Python | `create_agent_devtools()` | `devtools=` on `run()`, `stream()` or a continuation | `create_agent_devtools(directory=".local/agent-runs")` |
| Go | `CreateAgentDevtools(directory)` | `Devtools` on `RunOptions` or `ContinueOptions` | The `directory` argument |
| C# | `AgentSdk.CreateAgentDevtools(directory)` | `Devtools` on `RunOptions` or `ContinueOptions` | The `directory` argument (default `.phaseo-devtools`) |
| PHP | `AgentSdk::createAgentDevtools($directory)` | `devtools:` on `run()` or `continueRun()` | The `$directory` argument (default `.phaseo-devtools`) |
| Ruby | `PhaseoAgentSdk.create_agent_devtools(directory:, enabled:)` | `devtools:` on `run` or `continue_run` | `directory:` (default `.phaseo-devtools`) |
| Java | `AgentSdk.createAgentDevtools(directory)` | The `devtools` argument of `RunOptions` or `ContinueOptions` | The `directory` argument |

## Turn capture on from the environment

Without a DevTools config, capture turns on when `PHASEO_DEVTOOLS=true`. Files go to `PHASEO_DEVTOOLS_DIR`, or `.phaseo-devtools` in the working directory if that's unset. This works the same in every language that has DevTools.

## What gets written

| File | Contents |
| - | - |
| `generations.jsonl` | One entry per run and one per continuation |
| `metadata.json` | Session ID, start time and the SDK name (`"sdk": "typescript"`, `"python"`, `"go"`, `"csharp"`, `"php"`, `"ruby"` or `"java"`), written once |
| `assets/images`, `assets/audio`, `assets/video` | Created empty for the DevTools viewer |

Each entry's `type` is `agent.run` for a run and `agent.continue` for a continuation. `agent.continue` is an entry type, not a method name: it's what a call to `continueRun()` (TypeScript, PHP, Java), `continue_run()` (Python, Ruby), `Continue` (Go) or `ContinueRun` (C#) writes.

An entry holds the run and agent IDs, the tool count, and the full run result: status, messages, steps with model, provider and gateway request IDs, tool activity, usage and output. A run that fails gets an entry with the error (`error.message` in Go and Java; structured failure details in TypeScript). In Java, write errors are ignored, so capture never fails a run.

> [!WARNING]
>
> Entries hold prompts, messages, application context, tool inputs and tool outputs in plain text. Keep the directory out of source control and production images, and don't use it as an audit store. For production telemetry, use [lifecycle hooks](https://phaseo.app/docs/v1/sdk-reference/agent/lifecycle-hooks.md).


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