Skip to content

Getting started

1. Generate an API token

API tokens are managed from your Civitai account page:

  1. Sign in to civitai.com.
  2. Open Account settings.
  3. Scroll to the API Keys section and click Add API key.
  4. Give the key a name and copy the generated token — it's shown only once.

Store the token somewhere safe. Treat it like a password.

2. Make your first request

Most site API endpoints are public — you can call them without a token:

bash
curl "https://civitai.com/api/v1/models?limit=1"

Try it right here:

GET

Response (truncated):

json
{
  "items": [
    {
      "id": 827184,
      "name": "WAI-illustrious-SDXL",
      "type": "Checkpoint",
      "creator": { "username": "WAI0731" },
      "modelVersions": [ /* ... */ ]
    }
  ],
  "metadata": {
    "nextCursor": "75363|932023|257749",
    "nextPage": "https://civitai.com/api/v1/models?limit=1&cursor=..."
  }
}

3. Make an authenticated request

Some endpoints require a token — for example /me, which identifies the caller:

bash
export CIVITAI_TOKEN="your-token-here"

curl -H "Authorization: Bearer $CIVITAI_TOKEN" \
  "https://civitai.com/api/v1/me"
json
{
  "id": 12345,
  "username": "you",
  "tier": "founder",
  "status": "active",
  "isMember": true,
  "subscriptions": ["monthly"]
}

Set a token via the Token button in the navbar, then try it here:

GET

A few endpoints (GET /models with the favorites or hidden flag, for example) also require authentication even though the base endpoint is public. See Authentication for the full list.

Next steps

  • Authentication — token formats, query-param fallback, 401 behavior.
  • Pagination — walking through large result sets.
  • AIR identifiers — the URN format used throughout Civitai (and the Orchestration API).
  • Reference — parameters and response fields for every endpoint.

Civitai Developer Documentation