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

# Introduction

> Getting started with the TensorPool API

## Welcome to the TensorPool API

The TensorPool API provides programmatic access to TensorPool jobs and reousrces

## Base URL

The tensorpool API lives at

```
https://engine.tensorpool.dev
```

## Making Requests

All requests to the TensorPool API must be authenticated using a bearer token. Include your API token in the Authorization header:

```bash theme={null}
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
  https://engine.tensorpool.dev/job/list
```

## Async Operations

Mutating operations (cluster create/destroy, storage create/destroy/attach/detach, job cancel) are asynchronous. These endpoints return **HTTP 202 Accepted** with a `request_id` that you can use to track progress.

### Polling with Retry-After

Poll `GET /request/info/{request_id}` to check the status of an async operation. The response includes a `Retry-After` header indicating how many seconds to wait before polling again.

### Terminal States

Async operations reach one of two terminal states:

* **`COMPLETED`** — the operation succeeded
* **`FAILED`** — the operation failed (check the response for details)

### Example Flow

```bash theme={null}
# 1. Create a cluster (returns 202 with request_id)
curl -X POST https://engine.tensorpool.dev/cluster/create \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"instance_type": "1xH100", "ssh_key_id": "key_abc123"}'

# Response: 202 Accepted
# { "request_id": "req_abc123" }

# 2. Poll until terminal state
curl https://engine.tensorpool.dev/request/info/req_abc123 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Response includes Retry-After header
# { "status": "PENDING", ... }

# 3. Keep polling (respecting Retry-After) until COMPLETED or FAILED
# { "status": "COMPLETED", ... }
```

## Rate Limits

API requests are subject to rate limiting to ensure fair usage.

## Getting Help

* Join our [Slack community](https://tensorpool.dev/slack)
* Email us at [team@tensorpool.dev](mailto:team@tensorpool.dev)
