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

# Introduction

One HTTP + WebSocket API drives everything. The web console, the Python and TypeScript SDKs and the `orchard` CLI are all clients of it, so anything they do you can do directly.

## Base URL

```
https://<your-control-plane>/api
```

Every path in these pages is relative to that `/api` base. WebSocket channels live under `/ws` on the same host (see [WebSocket channels](/api/resources/websockets.md)).

## Two ways to authenticate

* **API key** (programmatic): a bearer token minted in the console under **Access > API keys**. Send it as `Authorization: Bearer <key>`. A key is bound to one organization and carries its own feature scope.
* **JWT** (the console): `POST /auth/token` with a username and password returns a short-lived access token and a refresh token.

See [Authentication](/api/authentication.md).

## Organizations and workspaces

A user can belong to several organizations, each with several workspaces. A request acts in one org and one workspace:

* An **API key** is bound to its org; it cannot switch.
* A **JWT** caller selects with the `X-Orchard-Org` and `X-Orchard-Workspace` headers, defaulting to the user's default org and workspace.

See [Conventions](/api/conventions.md) for headers, the common sandbox shape and error format.

## What you can address

* **Sandboxes (instances)**: iOS and Android devices on your nodes, plus cloud sandboxes, in one list. Node sandboxes are addressed by a stable **uuid**; cloud sandboxes by their **record id**. See [Sandboxes](/api/resources/instances.md) and [External sandboxes](/api/resources/remote.md).
* **Nodes**: the hosts that run device sandboxes. See [Nodes](/api/resources/nodes.md).

## Example

```bash
export ORCHARD_API_KEY=orc_...
curl -H "Authorization: Bearer $ORCHARD_API_KEY" \
  https://orchard.example.com/api/instances
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.orchard.airoverflow.com/api/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
