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

# API reference

> HTTP endpoints for tool discovery and execution, Play runs, and org billing.

The Deepline API uses JSON over HTTPS. Endpoint pages include an interactive
request builder, authentication, parameters, response schemas, and errors.

Base URL: `https://code.deepline.com`

Download the [OpenAPI specification](https://deepline.com/docs/openapi.json) for API clients and tooling.

## Authentication

Authenticated endpoints accept an org API key:

```http theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
Authorization: Bearer <DEEPLINE_API_KEY>
```

Create a key in your [org settings](https://code.deepline.com/dashboard/settings).
Keep it in your backend environment. Public discovery and health endpoints
identify when a key is not required. Permissions and billing apply to the
org associated with the key.

## Tools

| Endpoint | Purpose |
| - | - |
| [List tools](https://deepline.com/docs/api-reference/list-tools.md) | Browse callable actions and their schemas. |
| [Search tools](https://deepline.com/docs/api-reference/search-tools.md) | Find actions by task or capability. |
| [Describe a tool](https://deepline.com/docs/api-reference/get-tool.md) | Read an action’s input, output, access, and price. |
| [Execute a tool](https://deepline.com/docs/api-reference/execute-tool.md) | Call an action with a JSON payload. |
| [Look up an execution](https://deepline.com/docs/api-reference/get-tool-execution-by-key.md) | Recover a keyed execution without launching another call. |

Tool inputs and provider results vary by action. The describe response contains
that action’s schemas; the execution endpoint documents the shared envelope.

## Plays and runs

| Endpoint | Purpose |
| - | - |
| [List Plays](https://deepline.com/docs/api-reference/list-plays.md) | Find saved and prebuilt Plays. |
| [Describe a Play](https://deepline.com/docs/api-reference/get-play.md) | Read its inputs and output contract. |
| [Start a run](https://deepline.com/docs/api-reference/start-play-run.md) | Execute a saved or prebuilt Play. |
| [Get a run](https://deepline.com/docs/api-reference/get-run.md) | Read status and outputs for the same execution. |

Read the public run ID from `run.id`. URL-encode it before putting it in a path.
The default status response uses `run.status`; dataset rows have separate
paginated reads. See [Run Plays and view results](https://deepline.com/docs/sdk-v2/calling-plays.md) for a
complete SDK or CLI flow.

## Billing

| Endpoint | Purpose |
| - | - |
| [Get balance](https://deepline.com/docs/api-reference/get-billing-balance.md) | Read posted and spendable credits, holds, and availability. |
| [Get usage](https://deepline.com/docs/api-reference/get-billing-usage.md) | Inspect recent charges, one run, or an exact request. |
| [Read the ledger](https://deepline.com/docs/api-reference/get-billing-ledger.md) | Page through credits and debits, or export CSV. Requires org admin access. |

Billing responses show Deepline credits and Deepline USD. Pending or unavailable
amounts do not establish a final charge. [Rate cards](https://deepline.com/docs/_generated/pricing-schedule.md)
list action prices.

## Errors and retries

Each endpoint lists its possible errors. The response’s `error` can be a message
or an object with a code and message. Preserve the original run ID or execution
key when a submission outcome is uncertain. Retrying with a new identity can
start new paid work. See [tool execution recovery](https://deepline.com/docs/sdk-v2/tool-execution-recovery.md).

For Python, see [Call Plays from Python or HTTP](https://deepline.com/docs/sdk-v2/http-and-python.md).
The [TypeScript SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md) covers SDK methods.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.