API Documentation

Public REST API for programmatic access to quantumcomputer.dev

Authentication

Some endpoints require authentication via Bearer token. Generate a token in Settings.

curl -H "Authorization: Bearer qc_your_token_here" \
  https://quantumcomputer.dev/api/v1/me

Rate Limiting

API tokens are rate-limited to 100 requests per hour. When exceeded, the API returns HTTP 429 with a Retry-After header.

Base URL

https://quantumcomputer.dev/api/v1

Endpoints

Circuits

GET/api/v1/circuits/{username}/{slug}

Fetch a public circuit by its owner's username and slug. Increments the download counter.

curl https://quantumcomputer.dev/api/v1/circuits/alice/bell-state

# Response
{
  "circuit": {
    "id": "...",
    "slug": "bell-state",
    "name": "Bell State",
    "qasm": "OPENQASM 2.0; ...",
    "qubitCount": 2,
    "gateCount": 3,
    "tags": ["entanglement"],
    "downloads": 42
  },
  "owner": { "username": "alice", "displayName": "Alice" }
}
GET/api/v1/circuits/{username}

List all public circuits for a user.

curl https://quantumcomputer.dev/api/v1/circuits/alice

# Response
{ "circuits": [ { "id": "...", "slug": "bell-state", ... } ] }
POST/api/v1/circuitsAuth Required

Create a new circuit. Requires authentication. Free users are limited to 3 circuits.

curl -X POST https://quantumcomputer.dev/api/v1/circuits \
  -H "Authorization: Bearer qc_your_token" \
  -H "Content-Type: application/json" \
  -d '{"name": "GHZ State", "qasm": "OPENQASM 2.0; ...", "qubitCount": 3}'

# Response (201)
{ "circuit": { "id": "...", "slug": "ghz-state", ... } }

Users

GET/api/v1/users/{username}

Fetch a user's public profile and stats.

curl https://quantumcomputer.dev/api/v1/users/alice

# Response
{
  "user": { "username": "alice", "displayName": "Alice", "bio": "..." },
  "stats": { "articles": 5, "circuits": 12, "followers": 34 }
}
GET/api/v1/meAuth Required

Fetch the authenticated user's profile.

curl -H "Authorization: Bearer qc_your_token" \
  https://quantumcomputer.dev/api/v1/me

# Response
{ "user": { "id": "...", "username": "alice", "plan": "pro", ... } }

Python SDK

A Python SDK is coming soon. Install with:

pip install quantumcomputer-sdk