Civitai API
Civitai API Guide: Models, Images, Downloads and Authentication
The Civitai REST API exposes structured data for creators, images, models, model versions, hashes, and tags. It is useful for catalogs, download tools, metadata lookup, and reproducible AI workflows.
- 01 Request Endpoint and filters
- 02 Response Items and metadata
- 03 Next page Follow pagination
Civitai API key authentication
Public reads may work without a key, but authenticated requests are more reliable and can access resources tied to your account permissions. Generate a key on the Civitai Account page and send it as a bearer token.
Do not hard-code a token in shipped browser JavaScript, public repositories, shared URLs, analytics events, or logs. An app that accepts each user’s own key can keep it in that user’s browser, but must disclose local-storage/XSS risk and may still need a transient proxy where authenticated CORS is unavailable. Use a separate named key for each integration so you can revoke one without disrupting the others.
Note: Authorization: Bearer YOUR_API_KEY
Core Civitai API endpoints
The documented v1 REST surface includes creators, images, models, a single model, model versions, lookup by file hash, and tags. Model responses include creator, tags, statistics, permissions, versions, files, hashes, scan data, and example images when available.
The image endpoint supports filters such as model, version, user, maturity level, sort order, and time period. Returned generation metadata depends on what the uploader shared.
- GET /api/v1/creators: list and search creators.
- GET /api/v1/images: browse image records and metadata.
- GET /api/v1/models and /models/:id: query catalog records.
- GET /api/v1/model-versions/:id: resolve an exact version.
- GET /api/v1/model-versions/by-hash/:hash: identify a local file.
- GET /api/v1/tags: browse model tags.
Filter and paginate without overloading the API
Use the smallest useful page size and apply server-supported filters. Read pagination metadata or cursor values from the response instead of guessing page URLs. Cache catalog responses when freshness requirements allow it.
Handle 401, 403, 404, 429, and 5xx responses separately. Retry only transient failures, add jittered backoff, and cap attempts. Do not retry an invalid key or missing resource in a tight loop.
Resolve model downloads safely
Model-version records expose files and download URLs. Preserve the model ID, version ID, filename, and a strong hash beside the downloaded file. Verify that the response is the expected file rather than an HTML error page.
Respect creator permissions and Civitai terms. Avoid mirroring resources by default. Link to the source model page so users can review version notes and licenses.
How klopaper uses the Civitai API
klopaper searches Civitai media and LoRAs, resolves model-version resources, reads prompt metadata, and stages reusable text recipes. Civitai requests are authenticated server-side with klopaper’s own pooled token, so visitors never supply or store a Civitai key.
Generation is separate. klopaper runs the prepared recipe on its own hosted GPUs and debits your credits. Civitai remains the discovery and metadata source rather than the generation biller for those runs.
Questions
Civitai FAQ
Is the Civitai API free?
Public catalog access and account policies can change. Creating an API key is separate from paid generation or training, and current costs should be checked in Civitai.
How do I download a Civitai model with the API?
Resolve the exact model version, select its file download URL, authenticate when required, and verify the downloaded filename and hash.
Why does my Civitai API key not work?
Check for whitespace, revocation, required permissions, the Bearer header format, and whether the request is being sent from an allowed account context.
Run a Civitai model on klopaper
Browse Civitai models and LoRAs, then run the supported ones on klopaper. Every run executes on klopaper's own hosted GPUs and costs prepaid credits — no subscription, no provider account to set up.
Primary sources
klopaper is independent and is not affiliated with Civitai. Product interfaces, prices, and policies can change.