API in One/Docs/API Manual

API in One API Documentation

Use one API in One key for live chat, image, video, music, speech, and AI tool routes. Chat uses an OpenAI-compatible API; media and tool routes use REST async tasks with status polling.

API in One keeps provider credentials behind server-side routes, exposes clear model costs, and returns task IDs for long-running generation jobs. Account, credits, billing, and order pages continue through the shared dashboard.

Base URL
https://apiin.one/api/v1

Use this base URL with OpenAI-compatible clients and REST calls.

Auth
Bearer aio_...

Create and rotate API keys from the API Keys dashboard.

Task status
/tasks/{task_id}

Poll async media jobs or configure callback_url on supported routes.

Quick Start

Get Started Now

Generate an API key, set the API in One base URL, and call your first model with a bearer token.

cURL
curl --request POST \
  --url https://apiin.one/api/v1/chat/completions \
  --header "Authorization: Bearer aio_your_api_key" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "gemini",
    "messages": [
      {
        "role": "user",
        "content": "Compare image and video model routes for a product launch."
      }
    ],
    "stream": false
  }'

API Endpoints

API in One exposes category-level endpoints backed by existing BFF routes. Chat requests are synchronous and OpenAI-compatible; image, video, music, speech, and tool jobs use async task polling where generation can take longer.

Chat Completion API

Use OpenAI-compatible chat payloads for text, reasoning, code, and multimodal chat models.

POST/api/v1/chat/completions

Supports common OpenAI SDK configuration with baseURL and apiKey. Streaming support depends on the selected model.

Image Creation API

Create images from text prompts, source images, masks, or model-specific edit inputs.

POST/api/v1/images/generations

Most image jobs return a task_id immediately. Poll the task status endpoint to retrieve completed image URLs.

Video Creation API

Generate videos from text prompts or image inputs with async status tracking.

POST/api/v1/videos/generations

Video generation is long-running by design. Use callback_url for webhooks where the model supports it.

Music & Speech APIs

Build music generation, lyrics, covers, transcription, and text-to-speech workflows.

POST/api/v1/audio/music
POST/api/v1/audio/music/extend
GET/api/v1/audio/music/feed
POST/api/v1/audio/music/cover/generate
GET/api/v1/audio/music/cover/status
POST/api/v1/audio/music/upload-cover/generate
GET/api/v1/audio/music/upload-cover/status
POST/api/v1/audio/music/timestamped-lyrics
POST/api/v1/audio/speech

Suno endpoints include dedicated docs for generate, extend, feed, cover, upload-cover, and timestamped lyrics.

Task Status API

Check async task progress and retrieve final model outputs when jobs complete.

GET/api/v1/tasks/{task_id}

Task status responses normalize queued, processing, completed, and failed states across model providers.

AI Tool APIs

Run background removal, face swap, image upscale, video background removal, and video upscale jobs.

POST/api/v1/images/tools/remove-bg
POST/api/v1/images/tools/face-swap
POST/api/v1/images/tools/upscale
POST/api/v1/videos/tools/bg-remover
POST/api/v1/videos/tools/upscale

Tool routes are implemented as dedicated image and video endpoints, each with explicit paths and async task behavior.

Request Schema

Most endpoints accept a shared authorization header and a JSON body with a model slug. Media routes add async workflow fields such as callback_url and task status polling.

FieldTypeRequiredDescription
AuthorizationheaderYesBearer token from the API Keys dashboard. Keep it server-side.
modelstringYesModel slug such as gemini, imagen-4, kling-3, flux-2, or suno.
messagesarrayChatOpenAI-compatible role/content messages for chat completion routes.
promptstringMediaText prompt for image, video, music, speech, and tool workflows.
callback_urlstringNoWebhook URL for async completion notifications when supported by the selected route.

Response Format

Synchronous chat response

200

Chat routes return assistant content directly in OpenAI-compatible response shapes.

json
{
  "id": "chatcmpl_...",
  "object": "chat.completion",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "API in One routes the request through the selected model."
      }
    }
  ]
}

Async media task response

202

Image, video, music, and tool routes return a task ID for polling or webhook completion.

json
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "task_abc123",
    "status": "IN_PROGRESS"
  }
}

Platform Benefits

Transparent Pricing

Pay as you go with no subscription required. Clear per-model rates and dashboard usage tracking.

  • Clear per-model rates
  • No hidden fees
  • Only pay for successful jobs

Provider Route Abstraction

Model routes hide provider credentials and give your application one API in One key, one balance, and consistent task states.

Operational Visibility

Async routes expose queued, processing, completed, and failed states so production apps can handle provider latency and failures explicitly.

Server-Side Key Handling

Keep API in One keys in backend environments and call the gateway from your own server routes or jobs.

Clear Usage Boundaries

Model pages show cost, endpoint, webhook support, and task behavior so teams can plan usage before launch.

Real-Time Status

Monitor async task progress and retrieve final outputs from a single status endpoint.

SDKs & Code Examples

Use OpenAI-compatible SDKs for chat completion calls. For async image, video, music, speech, and tool jobs, submit the request first, then poll the task status endpoint until the output is ready.

Python SDK

Install with pip install openai, then set the API in One base URL and key.

python
from openai import OpenAI

client = OpenAI(
    api_key="aio_your_api_key",
    base_url="https://apiin.one/api/v1",
)

response = client.chat.completions.create(
    model="gemini",
    messages=[{"role": "user", "content": "Explain unified AI APIs"}],
)

Node.js SDK

Install with npm install openai and configure baseURL for server-side usage.

javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "aio_your_api_key",
  baseURL: "https://apiin.one/api/v1",
});

const response = await client.chat.completions.create({
  model: "gemini",
  messages: [{ role: "user", content: "Explain unified AI APIs" }],
});

Java SDK

OpenAI-compatible Java clients can use the same endpoint pattern with API in One credentials.

java
OpenAIClient client = OpenAIClient.builder()
  .apiKey("aio_your_api_key")
  .baseUrl("https://apiin.one/api/v1")
  .build();

Migration from OpenAI

For chat integrations, switch configuration first. Image, video, music, speech, and tool routes use their own REST payloads and async task flow.

  1. 1

    Get your API key

    Sign up for API in One and create a key from the dashboard.

  2. 2

    Update base URL

    Change your base URL to https://apiin.one/api/v1 while keeping familiar authorization headers.

  3. 3

    Test your endpoints

    Run a chat request with the new model slug, then test media and tool routes with their documented REST payloads and task states.

Supported Models via API in One Routes

Access 28 listed models through one gateway. Each model detail page includes parameters, pricing notes, request examples, and task status behavior.

Chat Completion Models

Language models for chat, reasoning, multimodal input, and code tasks.

  • Gemini: Google's most capable AI model for text generation, reasoning, and conversation.

Image Creation Models

Image creation and editing models for text prompts, references, and production visuals.

  • Flux 2: High-quality AI image generation with excellent prompt following and photorealistic output.
  • GPT Image 1.5: OpenAI's GPT Image 1.5 — multimodal image generation and editing with text rendering capabilities.
  • Ideogram V3: Ideogram V3 — industry-leading text-to-image generation with best-in-class typography and design capabilities.
  • Ideogram V4: Ideogram V4 — high-quality text-to-image generation with strong typography, flexible sizes, and speed-quality controls.
  • Imagen 4: Google's Imagen 4 — photorealistic image generation with exceptional detail and prompt adherence.

Video Creation Models

Video generation models with async task tracking and webhook callbacks.

  • Kling 3.0: State-of-the-art AI video generation with 4K quality support. Text-to-video and image-to-video capabilities.
  • Hailuo 2.3: High-quality AI video generation by MiniMax. Supports image-to-video with standard and pro quality modes, cinematic motion quality.
  • Wan 2.6: Alibaba's Wan 2.6 video generation model. Supports text-to-video and image-to-video with high-fidelity output.
  • Vidu Q3: Vidu Q3 by Shengshu Technology — advanced AI video generation with strong motion understanding and character consistency.
  • PixVerse 5.6: PixVerse 5.6 — fast AI video generation with stylized output. Supports text-to-video and image-to-video.

Speech & Music Models

Audio generation, speech, music, lyrics, and cover workflows.

  • Suno: Full-featured AI music generation platform. Supports text-to-music, extend tracks, upload audio covers, generate cover images, and timestamped lyrics. 8 API endpoints.
  • ElevenLabs V3: Ultra-realistic text-to-speech with natural sounding voices. Supports multiple languages and voice styles.
  • MiniMax Music: MiniMax's AI music generation — create high-quality songs with vocals and instrumentals from text descriptions.

FAQ

How do I migrate from OpenAI?

Use the API in One base URL, pass your API in One key as a bearer token, and update the model slug. Chat APIs follow OpenAI-compatible conventions.

What production behavior should I plan for?

The platform focuses on transparent task states, provider route abstraction, consistent errors, and no credit charges for failed requests where the model integration supports it.

How does pricing compare to direct provider access?

Pricing is pay-as-you-go and visible on model pages and the cost reference page. Use those API in One credit costs as the source of truth.

Do async tasks support polling?

Yes. Long-running image, video, music, and tool jobs return task IDs that can be checked through GET /api/v1/tasks/{task_id}.