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

# Set up coding agents with SKILL.md

> Pair the SDK with a SKILL.md file so local coding agents can use your Phaseo integration consistently.

This recipe is for teams building internal tools, CLIs, or coding-agent workflows on top of the gateway SDKs.

> [!NOTE]
>
> Reusable Phaseo skills live in [`phaseo.app/docs`](https://phaseo.app/docs/.well-known/agent-skills/index.json). Install them first with:
>
> ```bash theme={null}
> npx skills add https://phaseo.app/docs --agent codex --skill '*'
> ```
>
> Then layer project-local instructions into the repository `SKILL.md`.

The main idea is simple:

* keep your SDK setup inside the repository
* add a `SKILL.md` file that teaches the agent how the project expects requests to be made
* point the agent at that file during setup so request patterns stay consistent

## 1. Install the SDK

If you're using TypeScript or JavaScript:

```bash npm theme={null}
npm install @phaseo/sdk
```

```bash pnpm theme={null}
pnpm add @phaseo/sdk
```

```bash yarn theme={null}
yarn add @phaseo/sdk
```

```bash bun theme={null}
bun add @phaseo/sdk
```

If you're using Python:

```bash theme={null}
pip install phaseo
```

## 2. Add a project-local skill file

Create `SKILL.md` in the repository root or the agent skill location your team uses.

```md theme={null}
# Phaseo Gateway

- Use `https://api.phaseo.app/v1` as the gateway base URL.
- Read the API key from `PHASEO_API_KEY`.
- Prefer the Responses API for new text integrations.
- Use preset slugs when the repository defines shared request defaults.
- Log request ids and model ids for debugging.
- For async video jobs, store the returned id and poll status until terminal.
```

## 3. Keep the first integration tiny

For coding agents, smaller request helpers are easier to reuse than large wrappers.

```ts theme={null}
import Phaseo from "@phaseo/sdk";

export const gateway = new Phaseo({
  apiKey: process.env.PHASEO_API_KEY!,
});
```

Then keep one obvious call path per surface:

* text generation
* async video
* embeddings
* image generation

## 4. What the skill should encode

Your `SKILL.md` should answer the questions that waste the most agent time:

* which endpoint family to prefer
* which environment variable holds credentials
* which model ids or preset slugs are approved
* how request ids should be logged
* how async jobs should be tracked

## 5. Recommended repository pattern

* SDK helper in one shared module
* `SKILL.md` next to the integration code or at repository root
* one short example per major endpoint
* one note covering request logging and error handling

This gives both humans and coding agents the same operational entrypoint.

## Related guides

* [Codex](https://phaseo.app/docs/v1/guides/integrations/codex.md)
* [AI SDK integration](https://phaseo.app/docs/v1/guides/integrations/ai-sdk.md)
* [Examples](https://phaseo.app/docs/v1/guides/examples.md)


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