PixAI API Documentation

Developer docs for the PixAI API: generate anime-style AI images with a REST API, API-key auth, async tasks and webhooks, then explore the v2 and v1 references.

The PixAI API lets your application generate anime-style AI artwork with the same models that power pixai.art, such as Tsubaki.3, 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

  1. 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?.
  2. Create a task. POST /v2/image/create with a prompt, a model and optional settings such as aspect ratio or style. The response is a task in waiting status.
  3. Wait for the result. Poll GET /v2/task/{id} no more than once every 1.5 seconds, or register a webhook and receive the task object when it finishes.
  4. Download the images. The completed task lists media URLs in outputs.mediaUrls; GET /v2/media/batch?ids= resolves media IDs to URLs (for images, the PUBLIC entry in urls; for videos, fileUrl). Store the files you need: generated media is not kept indefinitely.

Browse the documentation

Machine-readable versions

Need help?

Write to api@withpixai.art. See User feedback for details.