PixAI Platform

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

  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 /v1/task/{taskId} 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; GET /v1/media/{mediaId} returns the media object and GET /v1/media/{mediaId}/image redirects to the file. Store the files you need: generated media is not kept indefinitely.

Browse the documentation

Machine-readable versions

Need help?

Write to api@withpixai.art or join the #api-beta-test channel on the PixAI Discord. See User feedback for details.

On this page