---
title: "PixAI API Documentation"
description: "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."
canonical: "https://platform.pixai.art/en/docs"
last-updated: "2026-11-02"
---

# 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](https://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 [#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?](/en/docs/quick-start/enroll-in-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](/en/docs/references/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 [#browse-the-documentation]

<Cards>
  <Card title="Quick Start" description="Get API access, make your first request and learn the current limits." href="/en/docs/quick-start/enroll-in-api" />

  <Card title="Create an image (API v2)" description="Reference for POST /v2/image/create with aspect ratios, modes and style presets." href="/en/docs/api-v2/image/createImage" />

  <Card title="Tasks and media (API v1)" description="Read task status and retrieve or upload media by ID." href="/en/docs/api/task/getTask" />

  <Card title="Models" description="Available image models with IDs, versions and allowed sampling methods." href="/en/docs/references/models" />

  <Card title="Supported resolutions" description="Output sizes for each aspect ratio and resolution tier." href="/en/docs/references/supported-resolutions" />

  <Card title="Webhooks" description="Receive task status updates by POST instead of polling." href="/en/docs/references/webhook" />

  <Card title="Limits" description="Concurrency limits, polling guidance and features not yet available in the API." href="/en/docs/quick-start/limits" />

  <Card title="FAQ" description="Keys by email versus membership, maintenance notices, privacy of API generations." href="/en/docs/faq" />

  <Card title="Copyright and licensing" description="Who owns generated images and how PixAI models may be used commercially." href="/en/docs/about/copyright" />
</Cards>

Machine-readable versions [#machine-readable-versions]

* [/llms.txt](/llms.txt) lists every page of this documentation with a one-line summary; [/llms-full.txt](/llms-full.txt) contains all pages in one Markdown file.
* Append `.mdx` to any page URL to fetch that page as Markdown, for example [/en/docs/quick-start/limits.mdx](/en/docs/quick-start/limits.mdx).
* [/openapi.json](/openapi.json) is the OpenAPI 3.1 spec of API v2 ([YAML](/openapi-spec.v2.yaml)), and [/.well-known/api-catalog](/.well-known/api-catalog) lists the spec of each API version.

Need help? [#need-help]

Write to [api@withpixai.art](mailto:api@withpixai.art&#x29; or join the **#api-beta-test** channel on the [PixAI Discord](https://discord.com/invite/pixai). See [User feedback](/en/docs/about/feedback) for details.
