# Getting Started (/docs/reference)

> For AI agents, the [documentation index](https://bitrouter-docs-staging.up.railway.app/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

Call BitRouter through one of its supported [inference protocols](https://bitrouter-docs-staging.up.railway.app/docs/usage/responses-api). New integrations can start with Responses; existing clients can retain a supported request format.

> **warn**
>
> The BitRouter API is in early beta. Pin your integration to the behavior you test and review release notes before upgrading.

## Choose a deployment \[#choose-a-deployment]

| Deployment    | HTTP origin                | OpenAI-compatible SDK base URL | Caller credential                                |
| ------------- | -------------------------- | ------------------------------ | ------------------------------------------------ |
| Cloud         | `https://api.bitrouter.ai` | `https://api.bitrouter.ai/v1`  | Cloud API key or supported bearer credential     |
| Local default | `http://127.0.0.1:4356`    | `http://127.0.0.1:4356/v1`     | Local virtual key when authentication is enabled |

Cloud can be called directly from an application without running a local daemon. Local operation requires a running router and configured inference sources. [Authentication](https://bitrouter-docs-staging.up.railway.app/docs/reference/authentication) explains the credential boundaries.

## Get a Cloud credential \[#get-a-cloud-credential]

[Create a scoped Cloud API key](https://bitrouter-docs-staging.up.railway.app/docs/cli/cloud-management#create-an-api-key) with `inference:invoke`. Follow the CLI sign-in instructions on that page if you have not authenticated yet, then set the issued key in your application environment:

```bash
export BITROUTER_API_KEY='paste-your-cloud-key-here'
```

## Model discovery \[#model-discovery]

Use [GET /v1/models](https://bitrouter-docs-staging.up.railway.app/docs/reference/discovery/listModels) to discover catalog model IDs and the supported provider, model, and modality filters. A catalog entry does not grant account access or guarantee capacity for a request.

[Virtual Models](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/virtual-models#model-selector-forms) explains logical model IDs, explicit provider routes, and locally configured names. The separate [model market](https://bitrouter-docs-staging.up.railway.app/models) is an illustrative Elastic Inference preview, not the callable-model catalog.

## First Cloud request \[#first-cloud-request]

Choose a catalog model your account can access. The following request uses an example model ID; replace it with your selected ID or an enabled workspace routing preset:

```bash
curl https://api.bitrouter.ai/v1/responses \
  -H "Authorization: Bearer $BITROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-haiku-4.5","input":"Hello!"}'
```

Inspect the response status and `output` items. Authentication success or catalog presence alone does not guarantee a completed model request. [Inference APIs](https://bitrouter-docs-staging.up.railway.app/docs/usage/responses-api#responses) explains responses, streaming, tools, and continuation; [Endpoint Reference](https://bitrouter-docs-staging.up.railway.app/docs/reference/openai-responses/createResponse) owns the hosted request and response schema.

## Python client \[#python-client]

Use the [OpenAI Python SDK](https://developers.openai.com/api/reference/python) as a compatible client for the Responses request above:

```bash
python -m pip install openai
```

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.bitrouter.ai/v1",
    api_key=os.environ["BITROUTER_API_KEY"],
)
response = client.responses.create(
    model="anthropic/claude-haiku-4.5",
    input="Hello!",
)
print(response.output_text)
```

The SDK uses your BitRouter Cloud key and sends this request to BitRouter.
Compatibility depends on the fields and capabilities supported by the [BitRouter endpoint contract](https://bitrouter-docs-staging.up.railway.app/docs/reference/openai-responses/createResponse).

## Local router \[#local-router]

Follow [CLI Getting Started](https://bitrouter-docs-staging.up.railway.app/docs/cli/getting-started) to configure and start the daemon. Choose a selector listed by `bro models` for that configuration. Use its local origin and a local virtual key when authentication is enabled.

The [Inference APIs examples](https://bitrouter-docs-staging.up.railway.app/docs/usage/responses-api#choose-an-endpoint-and-model) show a local request. `bitrouter/auto` requires a local policy binding configured through [Auto Router](https://bitrouter-docs-staging.up.railway.app/docs/routing/auto-router); Cloud uses catalog IDs or enabled workspace presets.

<a id="route-a-request" />

## Choose an inference protocol \[#choose-an-inference-protocol]

[Inference APIs](https://bitrouter-docs-staging.up.railway.app/docs/usage/responses-api) compares Responses, Chat Completions, Messages, and GenerateContent, including request examples and compatibility limits.

## Manage and inspect BitRouter \[#manage-and-inspect-bitrouter]

Discovery, BYOK encryption bootstrap, health, and metrics are public. Account-bound management endpoints require a credential with the scope named by that endpoint.

* [Models & providers](https://bitrouter-docs-staging.up.railway.app/docs/reference/discovery/listModels) — Inspect the public catalog and aggregate platform usage.

* [Cloud management](https://bitrouter-docs-staging.up.railway.app/docs/reference/management/listNamespaces) — Manage namespaces, keys, billing, policy, presets, and OAuth clients.

* [BYOK encryption](https://bitrouter-docs-staging.up.railway.app/docs/reference/byok/getEncryptionPubkey) — Fetch the public key used for client-side provider-key encryption.

* [Health](https://bitrouter-docs-staging.up.railway.app/docs/reference/health/ping) — Probe whether the Cloud node is alive.

Use [Cloud Management](https://bitrouter-docs-staging.up.railway.app/docs/cli/cloud-management) for terminal workflows. The [BitRouter Cloud OpenAPI schema](https://bitrouter-docs-staging.up.railway.app/openapi.json) generates Endpoint Reference; the Cloud gateway separately publishes its [deployed schema](https://api.bitrouter.ai/openapi.json).