> For the complete documentation index, see [llms.txt](https://docs.usedecentral.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usedecentral.org/api-reference/index.md).

# API Reference

The Decentral API is an OpenAI-compatible REST API backed by the decentralized inference network. It accepts the same request shapes as the OpenAI API, returns the same response shapes, and supports the same streaming protocol.

**Base URL:** `https://api.usedecentral.org/v1`

Existing code that talks to the OpenAI API can typically be pointed at Decentral with a single line change. See \[OpenAI-compatible usage]\(

) for specifics.

***

## API sections

* \[Authentication]\(): API keys, wallet authentication, request signing
* \[Chat Completions]\(): `/v1/chat/completions` endpoint
* \[Models]\(): listing available models and their properties
* \[Jobs]\(): retrieving job status and on-chain receipts
* \[Webhooks]\(): event delivery for job and account events
* \[Errors]\(): error codes and handling

***

## Request format

All requests must include an `Authorization` header with a bearer token:

```
Authorization: Bearer dcntrl_live_your_key_here
```

Request bodies are JSON. All responses are JSON. Streaming responses use Server-Sent Events (SSE) in the same format as the OpenAI streaming protocol.

***

## Response headers

Every API response includes standard HTTP headers plus several Decentral-specific headers:

| Header                          | Description                                                         |
| ------------------------------- | ------------------------------------------------------------------- |
| `x-decentral-job-id`            | The unique job ID for this inference request                        |
| `x-decentral-tx-signature`      | The Solana transaction signature for the escrow lock                |
| `x-decentral-settlement-tx`     | The settlement transaction signature (appears after job completion) |
| `x-decentral-worker`            | The worker's on-chain address (for verification)                    |
| `x-decentral-credits-remaining` | Your remaining credit balance after this request                    |

***

## Rate limits

There are no rate limits enforced by a policy team. Capacity is dynamically priced by network demand. If no workers are available for the requested model tier, the API returns a `503` with a `retry_after` field.

Credit balance is the only hard constraint: requests fail with a `402` if your balance is insufficient for the model tier.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.usedecentral.org/api-reference/index.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
