> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apiany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> One API gateway for image, video, chat, and multimodal AI models.

APIAny.AI gives developers one stable API surface for production AI workflows across chat, image generation, video generation, and multimodal applications.

The public API stays stable while APIAny.AI handles model execution, billing, task history, and standardized responses behind a consistent developer experience.

<CardGroup cols={2}>
  <Card title="Unified model access" icon="route">
    Call public model IDs with one API key and one stable API surface.
  </Card>

  <Card title="Async media tasks" icon="clock">
    Long-running image and video generation jobs return a `task_id` immediately. Poll `GET /v1/tasks/{task_id}` to retrieve results when they are ready.
  </Card>

  <Card title="Multi-format chat" icon="message-square">
    Start with the OpenAI-compatible `/v1/chat/completions` endpoint, then adopt Anthropic-compatible `/v1/messages` or Gemini-compatible `/v1beta/models/{model}:generateContent` endpoints as your integration evolves.
  </Card>

  <Card title="Credits and traceability" icon="receipt">
    Every request can be tied to credits, task history, standardized results, and usage records.
  </Card>
</CardGroup>

## Base URL

<Snippet file="snippets/base-url.mdx" />

## Public API shape

APIAny.AI exposes a small, predictable set of public calling patterns:

* **Chat completions** — `POST /v1/chat/completions`: OpenAI-compatible text generation and chat.
* **Anthropic-compatible messages** — `POST /v1/messages`: Anthropic Messages-compatible request and response shape.
* **Gemini-compatible content generation** — `POST /v1beta/models/{model}:generateContent`: Gemini generateContent-compatible request and response shape; `{model}` is the public APIAny.AI model ID.
* **Image generation (async)** — `POST /v1/images/generations`: Create an asynchronous image generation task and receive a `task_id`.
* **Image generation (sync)** — `POST /v1/images/generations/sync`: Generate an image and wait for the result when the request fits a simple blocking workflow.
* **Image editing** — `POST /v1/images/edits`: Apply edits or inpainting to an existing image using a model and prompt.
* **Video generation (async)** — `POST /v1/videos/generations`: Create an asynchronous video generation task and receive a `task_id`.
* **Video generation (sync)** — `POST /v1/videos/generations/sync`: Generate a video and wait for the result when a blocking workflow is acceptable.
* **Task lookup** — `GET /v1/tasks/{task_id}`: Retrieve the current status and final result of any asynchronous image or video task.
* **Credits balance** — `GET /v1/credits/balance`: Check how many credits remain on your account at any time.

<Tip>
  Image and video generation endpoints are asynchronous by default. Your request returns a `task_id` immediately rather than blocking until the media is ready. Production systems should prefer asynchronous creation endpoints followed by task polling. Synchronous variants (`/sync`) are available for simple integrations where waiting for the result in a single request is acceptable.
</Tip>

## How it works

Send a request with a public model ID and your API key. APIAny.AI executes the model request, records usage, and returns a standardized response. Public model IDs are stable product contracts, so your integration can keep the same API shape as the model catalog evolves.

Last updated: 2026-07-06 11:00 (UTC+8)
