PixAI API Documentation
Developer documentation for the PixAI API. Generate anime-style AI images programmatically with a REST API, API-key authentication, asynchronous tasks and webhooks, then explore the v2 and v1 endpoint references.
The PixAI API lets your application generate anime-style AI artwork with the same models that power pixai.art, such as Tsubaki.2, Haruka v2 and Hoshino v2. It is a REST API served from https://api.pixai.art: you authenticate with an API key, submit a generation task, and collect the finished images when the task completes.
How the API works
- Get an API key. Request access from the PixAI API team or create a key from your PixAI profile, then send it as
Authorization: Bearer <key>on every call. See How can I use PixAI API?. - Create a task.
POST /v2/image/createwith a prompt, a model and optional settings such as aspect ratio or style. The response is a task inwaitingstatus. - Wait for the result. Poll
GET /v1/task/{taskId}no more than once every 1.5 seconds, or register a webhook and receive the task object when it finishes. - Download the images. The completed task lists media URLs;
GET /v1/media/{mediaId}returns the media object andGET /v1/media/{mediaId}/imageredirects to the file. Store the files you need: generated media is not kept indefinitely.
Browse the documentation
Quick Start
Get API access, make your first request and learn the current limits.
Create an image (API v2)
Reference for POST /v2/image/create with aspect ratios, modes and style presets.
Tasks and media (API v1)
Read task status and retrieve or upload media by ID.
Models
Available image models with IDs, versions and allowed sampling methods.
Supported resolutions
Output sizes for each aspect ratio and resolution tier.
Webhooks
Receive task status updates by POST instead of polling.
Limits
Concurrency limits, polling guidance and features not yet available in the API.
FAQ
Keys by email versus membership, maintenance notices, privacy of API generations.
Copyright and licensing
Who owns generated images and how PixAI models may be used commercially.
Machine-readable versions
- /llms.txt lists every page of this documentation with a one-line summary; /llms-full.txt contains all pages in one Markdown file.
- Append
.mdxto any page URL to fetch that page as Markdown, for example /en/docs/quick-start/limits.mdx.
Need help?
Write to api@withpixai.art or join the #api-beta-test channel on the PixAI Discord. See User feedback for details.