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

# Introduction

> Overview of the CUDO Compute REST API: concepts, authentication, versioning, and example requests.

<Tip>
  Welcome to the CUDO Compute API reference. Use these endpoints to provision and manage compute, storage, networking and supporting resources programmatically.
</Tip>

## Overview

The CUDO Compute API is a versioned, resource-oriented HTTPS REST API. It provides secure, programmatic access to the full range of CUDO Compute platform capabilities including clusters, virtual machines, bare metal, volumes, disks, networks, security groups, images, object storage, billing accounts and more.

All endpoints speak JSON over HTTPS and are designed for automation, infrastructure-as-code, and integration into internal tooling.

<CardGroup cols={3}>
  <Card title="Base URL" icon="globe" href="#base-url-versioning">
    rest.compute.cudo.org
  </Card>

  <Card title="Auth" icon="key" href="/docs/api/authentication">
    Bearer API keys in Authorization header
  </Card>

  <Card title="Errors" icon="warning" href="/docs/api/errors">
    AIP-193 structured error model
  </Card>
</CardGroup>

<a id="base-url-versioning" />

## Base URL & versioning

All current endpoints are served from:

```text theme={null}
https://rest.compute.cudo.org/v1/
```

The `v1` segment denotes the stable API surface. Additive, backwards-compatible changes (new fields, endpoints) may occur without prior notice. Any breaking changes will be announced in the <Link href="/docs/api/changelog">Changelog</Link> with advanced notice.

## Authentication

Authenticate every request with a Bearer API key:

```http theme={null}
Authorization: Bearer <your_api_key>
```

See the dedicated <Link href="/docs/api/authentication">Authentication</Link> page for creating and rotating keys, best practices, and troubleshooting. Requests without a valid key return `401 UNAUTHENTICATED`.

## Key concepts

| Concept                    | Description                                                                                |
| -------------------------- | ------------------------------------------------------------------------------------------ |
| Project                    | Logical namespace where you create resources (machines, clusters, volumes).                |
| Billing account            | Funding source; required before provisioning capacity.                                     |
| Data center                | Physical location for capacity (select for latency, compliance and hardware availability). |
| Cluster                    | Scalable pool of machines you manage as a unit.                                            |
| Volume                     | Persistent block storage attachable to cluster machines.                                   |
| Machine                    | A bare metal server.                                                                       |
| Virtual Machine            | A virtualized server instance.                                                             |
| Disk                       | Persistent block storage attachable to virtual machines.                                   |
| Image                      | Virtual machine boot template (OS and any customisations you have made).                   |
| Networks & security groups | Isolation and traffic control primitives.                                                  |

## Example: list billing accounts

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -s \
      -H "Authorization: Bearer $CUDO_API_KEY" \
      https://api.cudocompute.com/v1/billing-accounts | jq '.'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import os, requests

    BASE_URL = "https://api.cudocompute.com/v1"
    resp = requests.get(
        f"{BASE_URL}/billing-accounts",
        headers={"Authorization": f"Bearer {os.environ['CUDO_API_KEY']}"},
        timeout=30,
    )
    resp.raise_for_status()
    print(resp.json())
    ```
  </Tab>

  <Tab title="JavaScript (fetch)">
    ```js theme={null}
    const BASE_URL = 'https://api.cudocompute.com/v1';
    async function listBillingAccounts() {
      const res = await fetch(`${BASE_URL}/billing-accounts`, {
        headers: { 'Authorization': `Bearer ${process.env.CUDO_API_KEY}` }
      });
      if (!res.ok) throw new Error(res.status + ' ' + await res.text());
      console.log(await res.json());
    }
    listBillingAccounts();
    ```
  </Tab>
</Tabs>

Typical (truncated) successful JSON response:

```json theme={null}
[
  {
    "id": "1234567890",
    "name": "Primary Account"
  }
]
```

## Errors & status codes

All non-2xx responses use a structured envelope following <Link href="https://google.aip.dev/193" target="_blank">AIP-193</Link>. See <Link href="/docs/api/errors">Errors</Link> for field semantics and canonical code mapping. Handle retryable codes (`UNAVAILABLE`, `RESOURCE_EXHAUSTED`, `DEADLINE_EXCEEDED`, `ABORTED`) with exponential backoff + jitter. Do not parse human-readable `message` strings-use `status`, `code`, and `details`.

## Rate limiting

If you exceed per-key or per-resource limits you receive `429 RESOURCE_EXHAUSTED` (sometimes with a `RetryInfo` detail or `Retry-After` header). Implement capped exponential backoff (e.g. 0.5s, 0.8s, 1.3s ... up to 30s) and avoid tight retry loops.

## Tooling & integrations

<CardGroup cols={3}>
  <Card title="cudoctl CLI" icon="terminal" href="/docs/tools/cudoctl">Script resource lifecycle operations quickly.</Card>
  <Card title="Python Client" icon="python" href="/docs/tools/python-client">Programmatic convenience wrapper.</Card>
  <Card title="Terraform" icon="layers" href="https://registry.terraform.io/providers/CudoVentures/cudo/latest/docs">Manage infra as code.</Card>
</CardGroup>

Additional automation tooling examples (Terraform, Python) are covered in the <Link href="/tools/cli">Tools</Link> section.

## OpenAPI specification

The full machine-readable contract (parameters, schemas, auth) is published as an OpenAPI 3 document:

<Card title="OpenAPI (v1)" icon="file" target="_blank" href="/docs/openapi.json">
  Browse the specification file
</Card>

You can use it to generate strongly-typed clients, validate requests, or explore interactively.

## Next steps

<AccordionGroup>
  <Accordion title="Get an API key" icon="key" defaultOpen>
    Visit the <Link href="/docs/api/authentication">Authentication</Link> guide to create your first key.
  </Accordion>

  <Accordion title="Create infrastructure" icon="rocket">
    Follow the <Link href="/quickstart">Quickstart</Link> then deploy your first cluster or virtual machine.
  </Accordion>

  <Accordion title="Handle errors gracefully" icon="warning">
    Review <Link href="/docs/api/errors">Errors</Link> and implement structured handling + retries.
  </Accordion>

  <Accordion title="Track changes" icon="history">
    Monitor new endpoints & updates in the <Link href="/docs/api/changelog">Changelog</Link>.
  </Accordion>
</AccordionGroup>

<Note type="success">Need more examples? Let us know what languages & SDKs you want next.</Note>
