Todo lo que necesita para integrar API in One en su aplicación.
Autenticación
Todas las solicitudes de API requieren un token Bearer en el encabezado Authorization. Puede gestionar sus claves API desde el panel de control.
http
1
Authorization: Bearer aio_your_api_key_here
Obtenga su clave API: Cree su clave API gratuita desde la página de Claves API en su panel de control. Las cuentas nuevas reciben créditos de bonificación para explorar la plataforma.
URL Base
https://apiin.one/api/v1
Endpoints de la API
Click each endpoint to see full parameter details, example requests, and response format.
POST/api/v1/images/generationsImage generation
Generate images using AI models. Specify the model in the request body. The model field determines which image generation engine is used. Returns a task_id for async polling.
Request Body Parameters
Body ParametersJSON
model:string
Model slug. See Supported Models below for available options.
prompt:string
Text description of the image to generate (3–5000 chars)
aspect_ratio:optional string
Output aspect ratio (e.g. 1:1, 16:9, 9:16) Defaults to 1:1.
type:optional string
Generation mode. Model-specific, e.g. pro/flex for Flux 2, text-to-image/edit for Seedream
resolution:optional string
Output resolution. Model-specific, e.g. 1K/2K for Flux 2
quality:optional string
Quality level. Model-specific, e.g. medium/high for GPT Image
input_urls:optional array
Array of image URLs for image-to-image or editing mode
negative_prompt:optional string
Elements to avoid in the generated image (not all models support this)
seed:optional number
Random seed for reproducibility (not all models support this)
curl-X POST https://apiin.one/api/v1/images/generations\
2
-H"Authorization: Bearer aio_your_api_key"\
3
-H"Content-Type: application/json"\
4
-d '{
5
"model": "flux-2",
6
"prompt": "A serene Japanese garden with cherry blossoms",
7
"aspect_ratio": "16:9",
8
"type": "pro",
9
"resolution": "1K"
10
}'
Example Response
json
1
{
2
"code": 200,
3
"message": "success",
4
"data": {
5
"task_id": "n41xxxx_flux2",
6
"status": "IN_PROGRESS"
7
}
8
}
POST/api/v1/videos/generationsVideo generation
Generate videos using AI models. Supports text-to-video and image-to-video. The model field determines which video engine is used. Returns a task_id for async polling.
Request Body Parameters
Body ParametersJSON
model:string
Model slug. See Supported Models below for available options.
prompt:string
Text description of the video (max 2500 chars for most models)
image:optional string
Image URL for image-to-video mode. Auto-detected by most models.
mode:optional string
Quality mode. Model-specific, e.g. std/pro for Kling 3
duration:optional number | string
Video duration in seconds. Model-specific (Kling 3: 3–15s, others vary) Defaults to 5.
aspect_ratio:optional string
Output aspect ratio (1:1, 9:16, 16:9) Defaults to 16:9.
resolution:optional string
Output resolution. Model-specific, e.g. 480p, 720p, 1080p
sound:optional boolean
Enable audio generation in the video (Kling 3) Defaults to true.
generateAudio:optional boolean
Enable audio generation (Seedance) Defaults to false.
generate_audio_switch:optional boolean
Enable audio generation (PixVerse) Defaults to false.
curl-X POST https://apiin.one/api/v1/videos/generations\
2
-H"Authorization: Bearer aio_your_api_key"\
3
-H"Content-Type: application/json"\
4
-d '{
5
"model": "kling-3",
6
"prompt": "A golden retriever running through sunflowers at sunset",
7
"mode": "std",
8
"duration": 5,
9
"aspect_ratio": "16:9",
10
"sound": true
11
}'
Example Response
json
1
{
2
"code": 200,
3
"message": "success",
4
"data": {
5
"task_id": "n75xxxx_kling3",
6
"status": "IN_PROGRESS"
7
}
8
}
POST/api/v1/audio/musicMusic generation
Generate original music from text descriptions. Suno supports both "inspiration mode" (text description) and "custom mode" (lyrics + style + title). MiniMax Music supports lyrics-driven generation. Returns a task_id for async polling.
Request Body Parameters
Body ParametersJSON
model:string
Model: suno (defaults to chirp-v3-5) or minimax-music
prompt:optional string
Lyrics (Suno custom mode) or style description (MiniMax). Max 3000 chars for Suno v3.5/v4, 5000 for v4.5+.
gpt_description_prompt:optional string
Text description for Suno inspiration mode. Max 400 chars.
style:optional string
Musical style/genre (Suno custom mode). Max 1000 chars.
title:optional string
Song title (Suno). Max 80 characters.
make_instrumental:optional boolean
Generate instrumental only, no vocals (Suno) Defaults to false.
"prompt": "Verse 1: Walking down the street\nChorus: Summer dreams",
7
"style": "pop, upbeat, electronic",
8
"title": "Summer Dreams",
9
"make_instrumental": false
10
}'
Example Response
json
1
{
2
"code": 200,
3
"message": "success",
4
"data": {
5
"task_id": "n7xxxx_suno",
6
"status": "IN_PROGRESS"
7
}
8
}
POST/api/v1/audio/speechText to speech
Convert text to natural-sounding multi-voice dialogue speech using ElevenLabs V3. Supports 30+ languages and automatic language detection. Returns a task_id for async polling.
Request Body Parameters
Body ParametersJSON
model:string
Model slug: elevenlabs-v3
dialogue:array
Array of dialogue items: [{text: ..., voice: ...}]. Voice is optional.
stability:optional number
Voice stability (0–1). Lower = more variation, higher = more consistent. Defaults to 0.5.
language_code:optional string
Language code (e.g. en, zh, ja) or auto for detection Defaults to auto.
curl-X POST https://apiin.one/api/v1/audio/speech\
2
-H"Authorization: Bearer aio_your_api_key"\
3
-H"Content-Type: application/json"\
4
-d '{
5
"model": "elevenlabs-v3",
6
"dialogue": [
7
{"text": "Hello, welcome to API in One.", "voice": "narrator"},
8
{"text": "Thank you! Tell me more.", "voice": "user"}
9
],
10
"stability": 0.5,
11
"language_code": "auto"
12
}'
Example Response
json
1
{
2
"code": 200,
3
"message": "success",
4
"data": {
5
"task_id": "n58xxxx_tts",
6
"status": "IN_PROGRESS"
7
}
8
}
POST/api/v1/chat/completionsChat / LLM
Chat completions in OpenAI-compatible format. Supports SSE streaming by default. Powered by Gemini (defaults to Gemini 3 Flash). Returns a synchronous or streamed response (not async task).
Request Body Parameters
Body ParametersJSON
model:string
Model slug: gemini. Backend defaults to Gemini 3 Flash.
messages:array
Array of message objects: [{role: user|assistant|system|developer, content: ...}]
stream:optional boolean
Enable SSE streaming. Responses are sent as Server-Sent Events. Defaults to true.
include_thoughts:optional boolean
Include model reasoning/thinking steps in response Defaults to true.
reasoning_effort:optional string
Reasoning depth: low or high Defaults to high.
tools:optional array
Array of tool definitions for function calling (OpenAI-compatible format)
response_format:optional object
Force structured output format (e.g. {type: json_object})
Remove image backgrounds instantly with AI precision. No model field required. 1 credit per image. Returns a task_id for async polling.
Request Body Parameters
Body ParametersJSON
image:string
URL of the image to remove background from
Example Request
bash
1
curl-X POST https://apiin.one/api/v1/images/tools/remove-bg\
2
-H"Authorization: Bearer aio_your_api_key"\
3
-H"Content-Type: application/json"\
4
-d '{
5
"image": "https://example.com/photo.jpg"
6
}'
Example Response
json
1
{
2
"code": 200,
3
"message": "success",
4
"data": {
5
"task_id": "n19xxxx_bgremove"
6
}
7
}
POST/api/v1/images/tools/face-swapFace swap
Swap faces in images with natural-looking results. Requires a target image (body/scene) and a source face image. 4 credits per swap. Returns a task_id for async polling.
Request Body Parameters
Body ParametersJSON
image:string
URL of the target image (the body/scene to modify)
face_image:string
URL of the source face image (the face to swap in)
target_index:optional number
Face index in target image if multiple faces detected (0–10) Defaults to 0.
output_format:optional string
Output format: jpeg, png, or webp Defaults to jpeg.
Example Request
bash
1
curl-X POST https://apiin.one/api/v1/images/tools/face-swap\
Remove or replace video backgrounds with AI. Supports optional custom background image replacement. 10 credits per video. Returns a task_id for async polling.
Request Body Parameters
Body ParametersJSON
video:string
URL of the video to process
background_image:optional string
URL of a custom background image to replace with
Example Request
bash
1
curl-X POST https://apiin.one/api/v1/videos/tools/bg-remover\
2
-H"Authorization: Bearer aio_your_api_key"\
3
-H"Content-Type: application/json"\
4
-d '{
5
"video": "https://example.com/talking-head.mp4"
6
}'
Example Response
json
1
{
2
"code": 200,
3
"message": "success",
4
"data": {
5
"task_id": "n53xxxx_vbgr",
6
"status": "IN_PROGRESS"
7
}
8
}
GET/api/v1/tasks/{task_id}Check task status
Poll the status of any asynchronous generation task. The task_id is returned by all generation endpoints (except chat/completions). Poll until status is "SUCCESS" or "FAILED".
Request Body Parameters
Body ParametersJSON
task_id:string (path)
The task ID returned by the generation endpoint (e.g. n41xxxx_flux2)
Example Request
bash
1
curlhttps://apiin.one/api/v1/tasks/n41xxxx_flux2\
2
-H"Authorization: Bearer aio_your_api_key"
Example Response
json
1
{
2
"code": 200,
3
"message": "success",
4
"data": {
5
"task_id": "n41xxxx_flux2",
6
"status": "SUCCESS",
7
"consumed_credits": 5,
8
"error_message": null,
9
"created_at": "2026-02-25T12:00:00Z",
10
"request": {
11
"model": "flux-2",
12
"prompt": "A serene Japanese garden..."
13
},
14
"response": [
15
"https://cdn.example.com/generated-image.png"
16
]
17
}
18
}
Formato de Solicitud
Todas las solicitudes usan un cuerpo JSON con un campo 'model' obligatorio para especificar qué modelo de IA usar. Los parámetros adicionales varían según el modelo.
json
1
{
2
"model": "flux-2",
3
"prompt": "A beautiful landscape",
4
"...other_params": "..."
5
}
El parámetro 'model' siempre es obligatorio. Visite la página de documentación de cada modelo para la lista completa de parámetros soportados.
Formato de Respuesta
Tareas Asíncronas (Imagen, Video, Música, Voz)
Para modelos de generación de contenido, la API devuelve un ID de tarea inmediatamente. Consulte el endpoint de estado para verificar cuándo se completa la tarea.
Initial response when task is created.
1
{
2
"id": "task_abc123",
3
"status": "pending",
4
"model": "kling-3",
5
"created_at": "2026-02-24T12:00:00Z"
6
}
Respuestas Síncronas (Chat)
Las respuestas de chat se devuelven directamente en una sola solicitud, siguiendo el formato compatible con OpenAI.
json
1
{
2
"id": "chatcmpl_xyz",
3
"model": "gemini",
4
"choices": [
5
{
6
"message": {
7
"role": "assistant",
8
"content": "..."
9
}
10
}
11
],
12
"usage": {
13
"prompt_tokens": 12,
14
"completion_tokens": 156,
15
"total_tokens": 168
16
},
17
"credits_consumed": 2
18
}
Manejo de Errores
endpoints_desc
json
1
{
2
"error": {
3
"code": 401,
4
"message": "Invalid API key",
5
"type": "authentication_error"
6
}
7
}
Body ParametersJSON
400:optional invalid_request
Parámetros de solicitud inválidos. Consulte la documentación del modelo para los campos requeridos.
401:optional authentication_error
La clave API falta, es inválida o fue revocada.
402:optional insufficient_credits
Su cuenta no tiene créditos suficientes. Compre más créditos para continuar.
404:optional not_found
El recurso solicitado (tarea, modelo) no fue encontrado.
429:optional rate_limit
Límite de velocidad excedido. El valor predeterminado es 60 solicitudes por minuto.
500:optional server_error
Error interno del servidor. Por favor, intente de nuevo después de un breve intervalo.
Inicio Rápido
1. Obtenga su clave API
Regístrese y cree una clave API desde su panel de control. Las cuentas gratuitas incluyen créditos de bonificación.
2. Realice su primera solicitud
bash
1
curl-X POST https://apiin.one/api/v1/images/generations\
2
-H"Authorization: Bearer aio_your_key"\
3
-H"Content-Type: application/json"\
4
-d '{
5
"model": "flux-2",
6
"prompt": "A serene Japanese garden with cherry blossoms"
7
}'
3. Verifique el estado de la tarea (modelos asíncronos)
bash
1
curlhttps://apiin.one/api/v1/tasks/task_abc123\
2
-H"Authorization: Bearer aio_your_key"
4. Explore más modelos
Navegue por nuestro directorio de modelos para encontrar el modelo de IA perfecto para su caso de uso.