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

# API Reference

RobinMesh serves inference through a REST API that mirrors the OpenAI API. Request bodies, response shapes, and the streaming wire protocol all match, while the work itself runs on a decentralized network of workers settling on Robinhood Chain.

**Base URL:** `https://api.robinmesh.com/v1`

If your application already speaks the OpenAI protocol, migrating usually comes down to swapping the base URL. The details live in \[OpenAI-compatible usage]\(

).

***

## API sections

* \[Authentication]\(): bearer keys, wallet-based auth, signing requests
* \[Chat Completions]\(): the `/v1/chat/completions` endpoint
* \[Models]\(): enumerating what the network is serving right now
* \[Jobs]\(): job status lookups and on-chain receipts
* \[Webhooks]\(): push notifications for job and account activity
* \[Errors]\(): status codes, error codes, and recovery

***

## Request format

Authenticate every call with a bearer token in the `Authorization` header:

```
Authorization: Bearer rmesh_live_your_key_here
```

Send JSON, receive JSON. When you opt into streaming, the API emits Server-Sent Events (SSE) that follow the OpenAI streaming format exactly.

***

## Response headers

Alongside the usual HTTP headers, each response carries a set of headers specific to RobinMesh:

| Header                          | Description                                                                  |
| ------------------------------- | ---------------------------------------------------------------------------- |
| `x-robinmesh-job-id`            | Identifier of the inference job created for this request                     |
| `x-robinmesh-tx-hash`           | Robinhood Chain transaction that locked the escrow                           |
| `x-robinmesh-settlement-tx`     | Transaction that settled the job (present once the job completes)            |
| `x-robinmesh-worker`            | On-chain address of the worker that served the request, so you can verify it |
| `x-robinmesh-credits-remaining` | Credit balance left on your account once this request is accounted for       |

***

## Rate limits

RobinMesh does not impose quota-style rate limits. Demand sets the price of capacity on the network, so throughput is governed by the market rather than by fixed ceilings. When no worker is hosting the tier you asked for, the API answers with a `503` carrying a `retry_after` field.

The one hard limit is your credit balance. A request whose tier costs more than you currently hold fails with a `402`.


---

# 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.robinmesh.com/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.
