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

# API Overview

B3IQ's endpoint-first developer surface: hosted gateway APIs, local host-agent APIs, private jobs, receipts, usage, and stable error codes.

B3IQ is endpoint-first. Developers call HTTP APIs directly. The official
developer surface is endpoint behavior, OpenAPI specs, examples, stable error
codes, and authorized operational metadata.

**No proprietary SDK**

B3IQ doesn't ship its own client library or adapter: the hosted gateway is
  OpenAI-compatible, so the official `openai` SDK (Python and JavaScript) and
  any OpenAI-compatible tooling work against it with just a base URL and key
  swap. See [OpenAI SDK Quickstart](/guides/openai-sdk-quickstart).

## API families

**[OpenAI SDK Quickstart](/guides/openai-sdk-quickstart)**

Point the official Python or JavaScript OpenAI SDK at the hosted gateway:
    chat completions, streaming, and `models.list()`.
  **[Hosted Gateway](/developers/hosted-gateway)**

Owner-scoped `/v1/api/models`, public `/v1/api/stats`, plus
    authenticated OpenAI-compatible `/v1/api/chat/completions` backed by B3IQ
    router, metering, and receipt policy.
  **[Local Host Agent](/developers/local-api)**

Local OpenAI-compatible endpoints and node companion APIs served at
    `http://127.0.0.1:8831` by default.
  **[Private Jobs](/developers/private-jobs)**

B3IQ-native async encrypted job APIs for private transport workflows.
  **[Receipts And Payouts](/developers/receipts-billing)**

Receipt lookup, settlement status, dashboard usage views, and payout
    evidence surfaces.
  **[b3iq CLI](/developers/cli)**

Manage your machines, models, runtimes, and SSH access from the terminal
    or a script, using the same account credentials as the HTTP APIs.

## OpenAI-compatible endpoint matrix

| Surface | Endpoint | Auth | Notes |
| --- | --- | --- | --- |
| Hosted metadata | ` https://b3iq.org/v1/api/models ` | Gateway key for your models | Anonymous calls return an empty list; owner keys see eligible models on their own machines |
| Hosted metadata | ` https://b3iq.org/v1/api/stats ` | None | Public aggregate network stats |
| Hosted metadata | ` https://b3iq.org/v1/api/pricing ` | None | Retained settlement-policy metadata, not a machine offer or customer inference price |
| Hosted gateway | ` https://b3iq.org/v1/api/chat/completions ` | Hosted gateway key | Free routed inference on your own machines, with metering, receipts, and route policy |
| Local host agent | ` http://127.0.0.1:8831/v1/chat/completions ` | Local `b3iq_local_` key | Local machine inference through the host agent |
| Native private jobs | ` https://b3iq.org/v1/api/private-inference/jobs ` | Customer headers | B3IQ-native encrypted async work, not OpenAI-compatible |

## Credential separation

| Surface | Credential | Notes |
| --- | --- | --- |
| Local host-agent chat | ` b3iq_local_ ` | Local-only scoped key created by the owner in the setup wizard |
| Hosted gateway chat | ` b3iq_gateway_ ` | Gateway key that carries account ownership and usage attribution |
| Native private jobs | ` customer headers ` | Customer ID and token headers for B3IQ-native job creation and settlement reads |
| Setup and local admin | ` owner session or setup token ` | Local operator UI and setup APIs, not normal application credentials |
| b3iq CLI and automation | ` b3iq_pat_ ` | Personal access token minted by `b3iq login` or Settings → CLI tokens; shown once, revocable |

## Base URLs

```bash
export B3IQ_GATEWAY_BASE_URL="https://b3iq.org/v1/api"
export B3IQ_LOCAL_BASE_URL="http://127.0.0.1:8831"
```

Use the public hosted gateway base URL for unauthenticated metadata and
authenticated hosted work. For local node work, use the host-agent URL on the
machine running B3IQ.

## Request safety pattern

**Store keys in files**

```bash
    umask 077
    mkdir -p .secrets
    cat > .secrets/b3iq-gateway-key
    cat > .secrets/b3iq-local-key
    ```
  **Pass auth through a short-lived config**

Avoid placing bearer tokens directly in shell argv.
  **Send request bodies through stdin**

This keeps examples readable and avoids local files that accidentally
    include prompts, outputs, or secret material.

## OpenAPI specs

**[Hosted Gateway OpenAPI](/reference/openapi)**

Hosted OpenAI-compatible chat/models plus B3IQ-native private job, receipt,
    billing, and public surfaces.
  **[Local Host-Agent OpenAPI](/reference/openapi)**

Local health, chat, models, model profiles, receipts, and receipt submission.

## Public privacy rule

Prompts, outputs, exact private routes, API keys, customer identity, local URLs,
filesystem paths, raw request logs, raw tokens, and raw TEE quotes do not belong
in public docs examples, diagnostic payloads, or historical settlement metadata.