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

# OpenCode

> Connect OpenCode to the AI Stats Gateway for multi-provider routing.

If OpenCode supports OpenAI-compatible backends, configure it to use the AI Stats base URL and API key.

## Recommended setup

* Base URL: `https://api.phaseo.app/v1`
* Auth: `Authorization: Bearer <AI_STATS_API_KEY>`
* Endpoint: `/chat/completions` or `/responses`

## Tips

* Verify model availability with the [Models endpoint](../../api-reference/endpoint/models.mdx).
* For Anthropic-compatible flows, prefer `/v1/messages`.
