{ "openapi": "3.1.0", "info": { "title": "API pública de APIAny.AI", "version": "1.0.0", "description": "API pública de APIAny.AI para agregación de modelos, tareas multimedia asíncronas, generación de conversaciones, consulta de créditos y consulta de tareas." }, "servers": [ { "url": "https://apiany.ai", "description": "Production" } ], "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "Models", "description": "Catálogo público de modelos." }, { "name": "Chat", "description": "Endpoints de generación de texto y compatibles con conversaciones." }, { "name": "Images", "description": "Endpoints de generación y edición de imágenes." }, { "name": "Videos", "description": "Endpoints de generación de vídeo." }, { "name": "Moderation", "description": "Image safety and moderation endpoints." }, { "name": "Tasks", "description": "Consulta de tareas asíncronas." }, { "name": "Account", "description": "Cuenta y consulta de créditos." }, { "name": "Free APIs", "description": "Free utility APIs protected by API key rate limits." } ], "paths": { "/v1/models": { "get": { "operationId": "listModels", "summary": "Obtener la lista pública de modelos", "description": "Devuelve el catálogo público de modelos de APIAny.AI visible para la API Key actual.", "tags": [ "Models" ], "responses": { "200": { "description": "Lista de modelos.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelListResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/v1/credits/balance": { "get": { "operationId": "getCreditBalance", "summary": "Consultar el saldo de créditos", "tags": [ "Account" ], "responses": { "200": { "description": "Saldo de créditos.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditBalanceResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } }, "description": "Devuelve el saldo de créditos disponible de la cuenta a la que pertenece la API Key actual." } }, "/v1/chat/completions": { "post": { "operationId": "createChatCompletion", "summary": "Crear una compleción de conversación", "description": "Endpoint de Chat Completions compatible con OpenAI. Actualmente se utiliza principalmente con llamadas sin streaming.", "tags": [ "Chat" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionRequest" }, "examples": { "basic": { "value": { "model": "gpt-5.4", "messages": [ { "role": "user", "content": "Write a concise product tagline for APIAny.AI." } ], "temperature": 0.7 } } } } } }, "responses": { "200": { "description": "Respuesta de compleción de conversación compatible con OpenAI.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/v1/responses": { "post": { "operationId": "createResponse", "summary": "Crear una respuesta de Responses", "description": "Endpoint compatible con OpenAI Responses. Admite el input nativo de Responses, controles de reasoning, herramientas integradas como web search y el SSE oficial de Responses cuando stream=true.", "tags": [ "Chat" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesRequest" }, "examples": { "reasoning": { "value": { "model": "gpt-5.5", "input": "Revisa este diseño de API y enumera los principales riesgos.", "reasoning": { "effort": "high", "summary": "auto" }, "text": { "verbosity": "medium" } } }, "webSearch": { "value": { "model": "gpt-5.5", "input": "¿Qué cambió recientemente en la documentación de la API OpenAI Responses?", "tools": [ { "type": "web_search_preview" } ] } } } } } }, "responses": { "200": { "description": "Respuesta de Responses compatible con OpenAI.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesResponse" } }, "text/event-stream": { "schema": { "type": "string", "description": "Cuando stream=true se devuelve un flujo de eventos SSE de Responses." } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/v1/messages": { "post": { "operationId": "createMessage", "summary": "Crear una respuesta de Messages", "description": "Endpoint de Messages compatible con Anthropic.", "tags": [ "Chat" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessagesRequest" }, "examples": { "basic": { "value": { "model": "minimax-m3", "max_tokens": 512, "messages": [ { "role": "user", "content": "Draft three API documentation section titles." } ] } } } } } }, "responses": { "200": { "description": "Respuesta de Messages compatible con Anthropic.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessagesResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/v1beta/models/{model}:generateContent": { "post": { "operationId": "generateGeminiContent", "summary": "Generar contenido compatible con Gemini", "description": "Endpoint generateContent compatible con Gemini. El model de la ruta es el ID público del modelo de APIAny.AI.", "tags": [ "Chat" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "example": "gemini-3.5-flash" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerateContentRequest" } } } }, "responses": { "200": { "description": "Respuesta compatible con Gemini.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerateContentResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/v1/images/generations": { "post": { "operationId": "createImageGeneration", "summary": "Crear una tarea de generación de imágenes", "description": "Crea una tarea de imagen asíncrona y devuelve su ID. GPT Image 2.6 usa output_format=png o gif. Consulte /v1/tasks/{task_id} y lea result.data[0].url al completarse.", "tags": [ "Images" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageGenerationRequest" }, "examples": { "textToImage": { "value": { "model": "nano-banana", "prompt": "A clean product hero image for an AI API gateway", "size": "1k" } }, "gptImage2NativeSize": { "value": { "model": "gpt-image-2", "prompt": "A cinematic landscape product launch visual", "size": "2048x1152", "quality": "high", "n": 1 } }, "withReferences": { "value": { "model": "nano-banana-pro", "prompt": "Create a premium ecommerce hero image using these references", "size": "2k", "input_images": [ "https://example.com/reference-1.png", "https://example.com/reference-2.png" ] } }, "gptImage26Png": { "value": { "model": "gpt-image-2.6", "prompt": "A polished studio photograph of an orange ceramic robot", "output_format": "png", "size": "1:1", "n": 1 } }, "gptImage26Gif": { "value": { "model": "gpt-image-2.6", "prompt": "A friendly orange robot waving in a smooth loop", "output_format": "gif", "size": "1:1", "n": 1 } } } } } }, "responses": { "202": { "description": "Tarea creada.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/v1/images/generations/sync": { "post": { "operationId": "createImageGenerationSync", "summary": "Crear una generación de imágenes y esperar el resultado", "description": "Crea una tarea de imagen y espera hasta el tiempo máximo. Una solicitud de GPT Image 2.6 completada devuelve una URL PNG o GIF animado en data[0].url. HTTP 202 indica que debe seguir consultando la tarea devuelta.", "tags": [ "Images" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageGenerationRequest" }, "examples": { "gptImage26Png": { "value": { "model": "gpt-image-2.6", "prompt": "A polished studio photograph of an orange ceramic robot", "output_format": "png", "size": "1:1", "n": 1 } }, "gptImage26Gif": { "value": { "model": "gpt-image-2.6", "prompt": "A friendly orange robot waving in a smooth loop", "output_format": "gif", "size": "1:1", "n": 1 } } } } } }, "responses": { "200": { "description": "Resultado de generación de imágenes compatible con OpenAI.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIImageResponse" } } } }, "202": { "description": "La tarea sigue procesándose tras alcanzar el tiempo máximo de espera.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/v1/images/edits": { "post": { "operationId": "createImageEdit", "summary": "Crear una edición de imágenes", "description": "La edición acepta URL de referencia en JSON o archivos en multipart/form-data. GPT Image 2.6 acepta una imagen de referencia y output_format=png o gif, sin máscara. HTTP 200 devuelve data[0].url; HTTP 202 devuelve una tarea para consultar.", "tags": [ "Images" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ImageEditRequest" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ImageGenerationRequest" }, "examples": { "gptImage26Png": { "value": { "model": "gpt-image-2.6", "prompt": "A polished studio photograph of an orange ceramic robot", "output_format": "png", "size": "1:1", "n": 1, "image_urls": [ "https://example.com/reference.png" ] } }, "gptImage26Gif": { "value": { "model": "gpt-image-2.6", "prompt": "A friendly orange robot waving in a smooth loop", "output_format": "gif", "size": "1:1", "n": 1, "image_urls": [ "https://example.com/reference.png" ] } } } } } }, "responses": { "200": { "description": "Resultado de imágenes compatible con OpenAI.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIImageResponse" } } } }, "202": { "description": "La tarea sigue pendiente o en proceso. Continúe consultando /v1/tasks/{task_id}.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/v1/images/upload": { "post": { "operationId": "uploadImageAsset", "summary": "Subir un recurso de imagen", "description": "Sube un recurso de imagen para usarlo como entrada de referencia en la generación de imágenes o vídeo.", "tags": [ "Images" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary" } }, "required": [ "file" ] } } } }, "responses": { "200": { "description": "URL del recurso subido.", "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" } }, "required": [ "url" ] } } } } } } }, "/v1/videos/generations": { "post": { "operationId": "createVideoGeneration", "summary": "Crear una tarea de generación de vídeo", "description": "Crea una tarea asíncrona de generación de vídeo y devuelve el task_id.", "tags": [ "Videos" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoGenerationRequest" }, "examples": { "seedance": { "value": { "model": "seedance-2.0", "prompt": "A cinematic launch shot for an AI API platform", "duration": "10s", "resolution": "720p", "ratio": "16:9" } }, "withReferences": { "value": { "model": "veo3.1", "prompt": "Animate a product scene between the start and end frames", "input_images": [ "https://example.com/start.png", "https://example.com/end.png" ] } } } } } }, "responses": { "202": { "description": "Tarea creada.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" } }, "parameters": [ { "name": "X-Client-Request-Id", "in": "header", "required": false, "description": "Optional UUID v4 correlation for seedance-2.5-video-edit only. Query /v1/tasks/req_edit_ with the same account to recover a lost submission response. This does not provide POST idempotency; never resubmit an uncertain request or reuse its UUID.", "schema": { "type": "string", "format": "uuid" } } ] } }, "/v1/videos/generations/sync": { "post": { "operationId": "createVideoGenerationSync", "summary": "Crear una generación de vídeo y esperar el resultado", "description": "Crea una tarea de vídeo y espera a que se complete dentro del tiempo máximo de espera configurado.", "tags": [ "Videos" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoGenerationRequest" } } } }, "responses": { "200": { "description": "Tarea de vídeo completada.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskResponse" } } } }, "202": { "description": "La tarea sigue procesándose tras alcanzar el tiempo máximo de espera.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/v1/tasks/{task_id}": { "get": { "operationId": "getTask", "summary": "Consultar el detalle de una tarea", "description": "Devuelve el estado actual y el resultado final de una tarea asíncrona de imagen, vídeo o, en el futuro, de audio.", "tags": [ "Tasks" ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "task_123", "description": "For a correlated Seedance 2.5 edit, req_edit_ can also resolve the original task under the authenticated account." } ], "responses": { "200": { "description": "Detalle de la tarea.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "description": "La tarea no existe.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/moderations": { "post": { "operationId": "createModeration", "summary": "Create image moderation result", "description": "Classifies an image with a public moderation model and returns a normalized safety result.", "tags": [ "Moderation" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModerationRequest" }, "examples": { "imageUrl": { "value": { "model": "nsfw-image-detection", "image_url": "https://example.com/image.png" } } } } } }, "responses": { "200": { "description": "Moderation result.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModerationResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/api/free/ip-geo": { "get": { "operationId": "lookupIpGeo", "summary": "Lookup IP geolocation", "description": "Returns country, region, and city for an IP address when GeoIP data is available.", "tags": [ "Free APIs" ], "parameters": [ { "name": "ip", "in": "query", "required": false, "schema": { "type": "string" }, "example": "8.8.8.8", "description": "IP address to look up. If omitted, the caller IP is used when proxy headers are available." } ], "responses": { "200": { "description": "IP geolocation result.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IpGeoResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "429": { "description": "Free API rate limit exceeded." } } } }, "/api/free/batch-convert-images": { "post": { "operationId": "batchConvertImages", "summary": "Batch convert images", "description": "Convert multiple images to one selected format and receive successful outputs in a ZIP archive with a manifest. This endpoint requires an API key from a paid account. One submitted batch counts as one API request.", "tags": [ "Free APIs" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "files" ], "properties": { "files": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "format": "binary" }, "description": "Image files. Each file can be up to 30 MB; the combined API request can be up to 100 MB." }, "format": { "type": "string", "enum": [ "webp", "png", "jpeg", "avif" ], "default": "webp" }, "quality": { "type": "integer", "minimum": 1, "maximum": 100, "default": 82 } } } } } }, "responses": { "200": { "description": "ZIP archive containing successful image outputs and manifest.json with ordered per-file results.", "content": { "application/zip": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The API key does not belong to an eligible paid account." }, "413": { "description": "File count, single-file size, or combined request size exceeds the documented limit." }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/free/batch-resize-images": { "post": { "operationId": "batchResizeImages", "summary": "Batch resize images", "description": "Apply one dimension, fit mode, output format, and quality setting to multiple images. This endpoint requires an API key from a paid account. One submitted batch counts as one API request.", "tags": [ "Free APIs" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "files", "width" ], "properties": { "files": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "format": "binary" }, "description": "Image files. Each file can be up to 30 MB; the combined API request can be up to 100 MB." }, "width": { "type": "integer", "minimum": 1, "maximum": 8192, "default": 1200 }, "height": { "type": "integer", "minimum": 1, "maximum": 8192 }, "fit": { "type": "string", "enum": [ "cover", "contain", "fill", "inside", "outside" ], "default": "inside" }, "format": { "type": "string", "enum": [ "webp", "png", "jpeg" ], "default": "webp" }, "quality": { "type": "integer", "minimum": 1, "maximum": 100, "default": 82 } } } } } }, "responses": { "200": { "description": "ZIP archive containing successful image outputs and manifest.json with ordered per-file results.", "content": { "application/zip": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The API key does not belong to an eligible paid account." }, "413": { "description": "File count, single-file size, or combined request size exceeds the documented limit." }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/free/batch-crop-images": { "post": { "operationId": "batchCropImages", "summary": "Batch crop images", "description": "Crop the same coordinate-based rectangle from multiple images with independent boundary validation. This endpoint requires an API key from a paid account. One submitted batch counts as one API request.", "tags": [ "Free APIs" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "files", "left", "top", "width", "height" ], "properties": { "files": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "format": "binary" }, "description": "Image files. Each file can be up to 30 MB; the combined API request can be up to 100 MB." }, "left": { "type": "integer", "minimum": 0, "default": 0 }, "top": { "type": "integer", "minimum": 0, "default": 0 }, "width": { "type": "integer", "minimum": 1, "maximum": 8192, "default": 500 }, "height": { "type": "integer", "minimum": 1, "maximum": 8192, "default": 500 }, "format": { "type": "string", "enum": [ "webp", "png", "jpeg" ], "default": "webp" } } } } } }, "responses": { "200": { "description": "ZIP archive containing successful image outputs and manifest.json with ordered per-file results.", "content": { "application/zip": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The API key does not belong to an eligible paid account." }, "413": { "description": "File count, single-file size, or combined request size exceeds the documented limit." }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/free/batch-rotate-images": { "post": { "operationId": "batchRotateImages", "summary": "Batch rotate images", "description": "Normalize orientation and apply one rotation or flip setting to multiple images. This endpoint requires an API key from a paid account. One submitted batch counts as one API request.", "tags": [ "Free APIs" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "files" ], "properties": { "files": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "format": "binary" }, "description": "Image files. Each file can be up to 30 MB; the combined API request can be up to 100 MB." }, "angle": { "type": "integer", "enum": [ 0, 90, 180, 270 ], "default": 90 }, "flip": { "type": "boolean", "default": false }, "flop": { "type": "boolean", "default": false }, "format": { "type": "string", "enum": [ "webp", "png", "jpeg" ], "default": "webp" } } } } } }, "responses": { "200": { "description": "ZIP archive containing successful image outputs and manifest.json with ordered per-file results.", "content": { "application/zip": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The API key does not belong to an eligible paid account." }, "413": { "description": "File count, single-file size, or combined request size exceeds the documented limit." }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/free/batch-image-metadata": { "post": { "operationId": "batchReadImageMetadata", "summary": "Batch read image metadata", "description": "Read a safe technical metadata allowlist for multiple images and return results in upload order. This endpoint requires an API key from a paid account. One submitted batch counts as one API request.", "tags": [ "Free APIs" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "files" ], "properties": { "files": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "format": "binary" }, "description": "Image files. Each file can be up to 30 MB; the combined API request can be up to 100 MB." } } } } } }, "responses": { "200": { "description": "Ordered batch result. Invalid files are reported individually without removing successful results.", "content": { "application/json": { "schema": { "type": "object", "required": [ "requestId", "operation", "status", "summary", "results" ], "properties": { "requestId": { "type": "string" }, "operation": { "type": "string" }, "status": { "type": "string", "enum": [ "completed", "partial", "failed" ] }, "summary": { "type": "object", "required": [ "total", "succeeded", "failed", "originalBytes" ], "properties": { "total": { "type": "integer" }, "succeeded": { "type": "integer" }, "failed": { "type": "integer" }, "originalBytes": { "type": "integer" } } }, "results": { "type": "array", "items": { "type": "object", "required": [ "index", "inputFilename", "status", "originalSize" ], "properties": { "index": { "type": "integer" }, "inputFilename": { "type": "string" }, "status": { "type": "string", "enum": [ "succeeded", "failed" ] }, "originalSize": { "type": "integer" }, "data": { "type": "object", "additionalProperties": true }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The API key does not belong to an eligible paid account." }, "413": { "description": "File count, single-file size, or combined request size exceeds the documented limit." }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/free/batch-color-palette": { "post": { "operationId": "batchExtractColorPalettes", "summary": "Batch extract color palettes", "description": "Extract representative HEX colors and approximate proportions independently from multiple images. This endpoint requires an API key from a paid account. One submitted batch counts as one API request.", "tags": [ "Free APIs" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "files" ], "properties": { "files": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "format": "binary" }, "description": "Image files. Each file can be up to 30 MB; the combined API request can be up to 100 MB." }, "count": { "type": "integer", "minimum": 3, "maximum": 8, "default": 5 } } } } } }, "responses": { "200": { "description": "Ordered batch result. Invalid files are reported individually without removing successful results.", "content": { "application/json": { "schema": { "type": "object", "required": [ "requestId", "operation", "status", "summary", "results" ], "properties": { "requestId": { "type": "string" }, "operation": { "type": "string" }, "status": { "type": "string", "enum": [ "completed", "partial", "failed" ] }, "summary": { "type": "object", "required": [ "total", "succeeded", "failed", "originalBytes" ], "properties": { "total": { "type": "integer" }, "succeeded": { "type": "integer" }, "failed": { "type": "integer" }, "originalBytes": { "type": "integer" } } }, "results": { "type": "array", "items": { "type": "object", "required": [ "index", "inputFilename", "status", "originalSize" ], "properties": { "index": { "type": "integer" }, "inputFilename": { "type": "string" }, "status": { "type": "string", "enum": [ "succeeded", "failed" ] }, "originalSize": { "type": "integer" }, "data": { "type": "object", "additionalProperties": true }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The API key does not belong to an eligible paid account." }, "413": { "description": "File count, single-file size, or combined request size exceeds the documented limit." }, "429": { "$ref": "#/components/responses/RateLimited" } } } }, "/api/free/batch-image-hash": { "post": { "operationId": "batchCalculateImageHashes", "summary": "Batch calculate image hashes", "description": "Calculate a SHA-256 checksum for each accepted image and return ordered per-file results. This endpoint requires an API key from a paid account. One submitted batch counts as one API request.", "tags": [ "Free APIs" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "files" ], "properties": { "files": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "format": "binary" }, "description": "Image files. Each file can be up to 30 MB; the combined API request can be up to 100 MB." } } } } } }, "responses": { "200": { "description": "Ordered batch result. Invalid files are reported individually without removing successful results.", "content": { "application/json": { "schema": { "type": "object", "required": [ "requestId", "operation", "status", "summary", "results" ], "properties": { "requestId": { "type": "string" }, "operation": { "type": "string" }, "status": { "type": "string", "enum": [ "completed", "partial", "failed" ] }, "summary": { "type": "object", "required": [ "total", "succeeded", "failed", "originalBytes" ], "properties": { "total": { "type": "integer" }, "succeeded": { "type": "integer" }, "failed": { "type": "integer" }, "originalBytes": { "type": "integer" } } }, "results": { "type": "array", "items": { "type": "object", "required": [ "index", "inputFilename", "status", "originalSize" ], "properties": { "index": { "type": "integer" }, "inputFilename": { "type": "string" }, "status": { "type": "string", "enum": [ "succeeded", "failed" ] }, "originalSize": { "type": "integer" }, "data": { "type": "object", "additionalProperties": true }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "description": "The API key does not belong to an eligible paid account." }, "413": { "description": "File count, single-file size, or combined request size exceeds the documented limit." }, "429": { "$ref": "#/components/responses/RateLimited" } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "API key" } }, "responses": { "BadRequest": { "description": "Parámetros de solicitud no válidos.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "Unauthorized": { "description": "Falta la API Key o la API Key no es válida.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "RateLimited": { "description": "La solicitud superó el límite de frecuencia.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "schemas": { "ErrorResponse": { "type": "object", "properties": { "error": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "invalid_request", "auth_error", "rate_limit", "insufficient_quota", "content_policy", "timeout", "network_error", "service_error", "billable_error", "unknown" ] }, "message": { "type": "string" }, "param": { "type": [ "string", "null" ] }, "code": { "type": [ "string", "null" ] } }, "required": [ "type", "message" ] } }, "required": [ "error" ] }, "ModelListResponse": { "type": "object", "properties": { "object": { "type": "string", "example": "list" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Model" } } }, "required": [ "data" ] }, "Model": { "type": "object", "properties": { "id": { "type": "string", "example": "nano-banana" }, "object": { "type": "string", "example": "model" }, "type": { "type": "string", "example": "image" }, "owned_by": { "type": "string", "example": "APIAny.AI" }, "display_name": { "type": "string", "example": "Nano Banana" }, "status": { "type": "string", "example": "active" }, "pricing": { "type": "object", "additionalProperties": true }, "parameters": { "type": "object", "additionalProperties": true }, "group": { "type": "string", "description": "Grupo del modelo que se muestra en el catálogo de modelos.", "example": "GPT 5.5" }, "capability": { "type": "string", "description": "Etiquetas de capacidad separadas por comas.", "example": "chat,coding,reasoning" }, "description": { "type": "string" }, "capability_metadata": { "type": ["object", "null"], "description": "Metadatos de capacidades del modelo: tipos de entrada y salida admitidos, indicadores de funciones, niveles de pensamiento y razonamiento, límites y etiquetas. Es null cuando el modelo no declara metadatos de capacidades.", "properties": { "modality": { "type": "string", "example": "chat" }, "endpoint_formats": { "type": "array", "items": { "type": "string" }, "example": ["openai-chat", "openai-responses", "anthropic-messages", "gemini-generate-content"] }, "execution": { "type": "string", "example": "sync" }, "input": { "type": "object", "description": "Tipos de entrada que acepta el modelo.", "properties": { "text": { "type": "boolean" }, "image": { "type": "boolean" }, "audio": { "type": "boolean" }, "video": { "type": "boolean" }, "file": { "type": "boolean" } } }, "output": { "type": "object", "properties": { "text": { "type": "boolean" }, "image": { "type": "boolean" }, "video": { "type": "boolean" }, "audio": { "type": "boolean" } } }, "features": { "type": "object", "properties": { "stream": { "type": "boolean" }, "tools": { "type": "boolean" }, "vision": { "type": "boolean" }, "jsonMode": { "type": "boolean" }, "thinking": { "type": "boolean" } } }, "reasoning": { "type": ["object", "null"], "description": "Declaración del pensamiento y de los niveles de effort para modelos de chat. Es null o no está presente cuando el modelo no tiene controles de razonamiento.", "properties": { "supported": { "type": "boolean", "description": "Indica si el modelo puede razonar." }, "mode": { "type": "string", "enum": ["always-on", "optional", "none"], "description": "always-on: el razonamiento no se puede desactivar. optional: se puede desactivar. none: el modelo no tiene modo de razonamiento." }, "parameter": { "type": "string", "example": "reasoning_effort" }, "aliases": { "type": "array", "items": { "type": "string" }, "example": ["reasoning.effort", "output_config.effort"] }, "efforts": { "type": "array", "items": { "type": "string" }, "description": "Niveles de razonamiento que acepta este modelo. Una lista vacía significa que el modelo no acepta un parámetro effort.", "example": ["low", "high", "max"] }, "compatEfforts": { "type": "object", "description": "Grafías de compatibilidad que se aceptan para integraciones anteriores y se asignan al nivel oficial que se usa realmente. Para las integraciones nuevas, es preferible usar los valores de efforts.", "example": { "max": "xhigh", "minimal": "low" } }, "defaultEffort": { "type": "string", "description": "Nivel predeterminado que se aplica cuando la solicitud omite effort. No está presente cuando el valor predeterminado no se publica.", "example": "max" }, "disableWith": { "type": "array", "items": { "type": "string" }, "description": "Formas aceptadas de desactivar el razonamiento en un modelo opcional.", "example": ["reasoning_effort=none"] }, "thinkingTypes": { "type": "array", "items": { "type": "string" }, "description": "Valores que acepta el objeto thinking cuando el modelo expone uno.", "example": ["enabled", "disabled"] } } }, "limits": { "type": "object", "additionalProperties": true }, "tags": { "type": "array", "items": { "type": "string" } }, "release_stage": { "type": "string", "example": "stable" }, "pricing_dimensions": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } }, "required": [ "id", "object", "type", "display_name", "status" ] }, "CreditBalanceResponse": { "type": "object", "properties": { "credits": { "type": "number", "example": 206353 }, "currency": { "type": "string", "example": "credits" } }, "required": [ "credits", "currency" ] }, "ChatCompletionRequest": { "type": "object", "properties": { "model": { "type": "string", "example": "gpt-5.4" }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/ChatMessage" } }, "temperature": { "type": "number", "minimum": 0, "maximum": 2, "description": "Temperatura de muestreo." }, "top_p": { "type": "number", "minimum": 0, "maximum": 1, "description": "Masa de probabilidad acumulada del muestreo por núcleo (nucleus)." }, "max_tokens": { "type": "integer", "minimum": 1, "deprecated": true, "description": "Alias de compatibilidad obsoleto de max_completion_tokens. Kimi K3 acepta ambas formas y utiliza max_completion_tokens." }, "max_completion_tokens": { "type": "integer", "minimum": 1, "maximum": 1048576, "description": "Máximo de tokens de razonamiento y respuesta final combinados. Se aplican límites por modelo; agotar el presupuesto puede dejar la respuesta incompleta. Kimi K3: 131072 (default), 1048576 (max)." }, "reasoning_effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh", "max" ], "description": "Intensidad del razonamiento. La enumeración indica valores sintácticamente válidos, no compatibilidad con todos los modelos. Los valores no admitidos devuelven 400. Kimi K3 admite low, high y max (por defecto max); GPT-5.4/5.5 admiten none, low, medium, high, xhigh. Límites de Claude y Gemini: /es/models/chat-models. Si se omite, se mantiene el comportamiento predeterminado del modelo. Los niveles aceptados, el valor predeterminado y si el razonamiento se puede desactivar se publican en GET /v1/models dentro de capability_metadata.reasoning." }, "stop": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Hasta 4 secuencias de parada." }, "n": { "type": "integer", "minimum": 1, "description": "Número de candidatos a generar." }, "frequency_penalty": { "type": "number", "minimum": -2, "maximum": 2 }, "presence_penalty": { "type": "number", "minimum": -2, "maximum": 2 }, "seed": { "type": "integer", "description": "Semilla de muestreo lo más reproducible posible." }, "response_format": { "type": "object", "description": "Fuerza la salida como objeto JSON o JSON Schema, p. ej. { \"type\": \"json_object\" }.", "additionalProperties": true }, "tools": { "type": "array", "description": "Declaraciones de herramientas/funciones que el modelo puede invocar.", "items": { "type": "object", "additionalProperties": true } }, "tool_choice": { "description": "Selección de herramienta: 'auto' | 'none' | 'required' | { type: 'function', function: { name } }.", "oneOf": [ { "type": "string" }, { "type": "object", "additionalProperties": true } ] }, "logprobs": { "type": "boolean" }, "top_logprobs": { "type": "integer", "minimum": 0, "maximum": 20 }, "logit_bias": { "type": "object", "additionalProperties": true }, "user": { "type": "string", "description": "Identificador del usuario final, para auditoría de riesgos." }, "stream": { "type": "boolean", "description": "Cuando es true, los incrementos se devuelven en streaming mediante SSE (OpenAI chat.completion.chunk) y terminan con 'data: [DONE]'." }, "reasoning": { "type": "object", "additionalProperties": true, "description": "Alias de compatibilidad de reasoning_effort. Si se indican ambas formas, los valores deben coincidir; los conflictos devuelven 400.", "properties": { "effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh", "max" ], "description": "Intensidad del razonamiento. La enumeración indica valores sintácticamente válidos, no compatibilidad con todos los modelos. Los valores no admitidos devuelven 400. Kimi K3 admite low, high y max (por defecto max); GPT-5.4/5.5 admiten none, low, medium, high, xhigh. Límites de Claude y Gemini: /es/models/chat-models. Si se omite, se mantiene el comportamiento predeterminado del modelo. Los niveles aceptados, el valor predeterminado y si el razonamiento se puede desactivar se publican en GET /v1/models dentro de capability_metadata.reasoning." } } } }, "required": [ "model", "messages" ] }, "ChatMessage": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "system", "user", "assistant", "tool" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "additionalProperties": true } } ] }, "reasoning_content": { "type": "string", "description": "Traza de razonamiento que debe conservarse en el historial assistant de Kimi K3." }, "partial": { "type": "boolean", "default": false, "description": "Modo parcial de Kimi, solo para el último mensaje assistant usado como prefijo." }, "tools": { "type": "array", "description": "Herramientas dinámicas de Kimi K3 en un mensaje system sin content.", "items": { "type": "object", "additionalProperties": true } } }, "required": [ "role" ] }, "ChatCompletionResponse": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string", "example": "chat.completion" }, "created": { "type": "integer" }, "model": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "usage": { "$ref": "#/components/schemas/TokenUsage" } }, "required": [ "id", "object", "created", "model", "choices" ] }, "ResponsesRequest": { "type": "object", "additionalProperties": true, "properties": { "model": { "type": "string", "example": "gpt-5.5" }, "input": { "description": "Input de Responses. Puede ser una cadena o un array de items message / tool-result.", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "additionalProperties": true } } ] }, "instructions": { "type": "string", "description": "Instrucciones del sistema o del desarrollador." }, "max_output_tokens": { "type": "integer", "minimum": 1, "description": "Máximo de tokens de razonamiento y respuesta final combinados. Se aplican límites por modelo; agotar el presupuesto puede dejar la respuesta incompleta." }, "temperature": { "type": "number", "minimum": 0, "maximum": 2 }, "top_p": { "type": "number", "minimum": 0, "maximum": 1 }, "reasoning": { "type": "object", "additionalProperties": true, "properties": { "effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh", "max" ], "description": "Intensidad del razonamiento. La enumeración indica valores sintácticamente válidos, no compatibilidad con todos los modelos. Los valores no admitidos devuelven 400. Kimi K3 admite low, high y max (por defecto max); GPT-5.4/5.5 admiten none, low, medium, high, xhigh. Límites de Claude y Gemini: /es/models/chat-models. Si se omite, se mantiene el comportamiento predeterminado del modelo. Los niveles aceptados, el valor predeterminado y si el razonamiento se puede desactivar se publican en GET /v1/models dentro de capability_metadata.reasoning." }, "summary": { "type": "string", "enum": [ "auto", "concise", "detailed" ] } } }, "text": { "type": "object", "additionalProperties": true, "properties": { "verbosity": { "type": "string", "enum": [ "low", "medium", "high" ] }, "format": { "type": "object", "additionalProperties": true } } }, "tools": { "type": "array", "description": "Herramientas de Responses, incluidas las function tools y herramientas integradas como web_search_preview.", "items": { "type": "object", "additionalProperties": true } }, "tool_choice": { "oneOf": [ { "type": "string" }, { "type": "object", "additionalProperties": true } ] }, "stream": { "type": "boolean", "description": "Cuando es true, se devuelven eventos SSE de OpenAI Responses." }, "metadata": { "type": "object", "additionalProperties": true }, "reasoning_effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh", "max" ], "description": "Alias de compatibilidad de reasoning.effort. Si se indican ambas formas, los valores deben coincidir; los conflictos devuelven 400. Intensidad del razonamiento. La enumeración indica valores sintácticamente válidos, no compatibilidad con todos los modelos. Los valores no admitidos devuelven 400. Kimi K3 admite low, high y max (por defecto max); GPT-5.4/5.5 admiten none, low, medium, high, xhigh. Límites de Claude y Gemini: /es/models/chat-models. Si se omite, se mantiene el comportamiento predeterminado del modelo. Los niveles aceptados, el valor predeterminado y si el razonamiento se puede desactivar se publican en GET /v1/models dentro de capability_metadata.reasoning." } }, "required": [ "model", "input" ] }, "ResponsesResponse": { "type": "object", "additionalProperties": true, "properties": { "id": { "type": "string" }, "object": { "type": "string", "example": "response" }, "created_at": { "type": "integer" }, "status": { "type": "string" }, "model": { "type": "string" }, "output": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "output_text": { "type": "string" }, "usage": { "$ref": "#/components/schemas/TokenUsage" } }, "required": [ "id", "object", "status", "model", "output" ] }, "AnthropicMessagesRequest": { "type": "object", "properties": { "model": { "type": "string", "example": "minimax-m3" }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "user", "assistant" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "additionalProperties": true } } ] } }, "required": [ "role", "content" ] } }, "max_tokens": { "type": "integer", "minimum": 1, "description": "Máximo de tokens de razonamiento y respuesta final combinados. Se aplican límites por modelo; agotar el presupuesto puede dejar la respuesta incompleta." }, "system": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "additionalProperties": true } } ], "description": "Prompt del sistema." }, "temperature": { "type": "number", "minimum": 0, "maximum": 1, "description": "Aleatoriedad (0–1)." }, "top_p": { "type": "number", "minimum": 0, "maximum": 1 }, "top_k": { "type": "integer", "description": "Muestrea solo entre los K candidatos de mayor probabilidad." }, "stop_sequences": { "type": "array", "items": { "type": "string" }, "description": "Secuencias de parada personalizadas." }, "tools": { "type": "array", "description": "Herramientas que el modelo puede invocar; cada una incluye name, description e input_schema (JSON Schema).", "items": { "type": "object", "additionalProperties": true } }, "tool_choice": { "type": "object", "additionalProperties": true, "description": "Selección de herramienta: { type: 'auto' } | { type: 'any' } | { type: 'tool', name }." }, "stream": { "type": "boolean", "description": "Cuando es true, se devuelve un flujo de eventos SSE de Anthropic (message_start / content_block_delta / message_delta / message_stop)." }, "output_config": { "type": "object", "additionalProperties": true, "description": "Control nativo de effort de Anthropic. Los valores dependen de la versión de Claude; consulta /es/models/chat-models. effort no activa thinking ni establece un presupuesto de tokens de pensamiento.", "properties": { "effort": { "type": "string", "enum": [ "low", "medium", "high", "xhigh", "max" ], "description": "Control nativo de effort de Anthropic. Los valores dependen de la versión de Claude; consulta /es/models/chat-models. effort no activa thinking ni establece un presupuesto de tokens de pensamiento." } } }, "thinking": { "type": "object", "additionalProperties": true, "description": "Configuración nativa de thinking de Anthropic, independiente de output_config.effort. type y budget_tokens deben ser compatibles con el modelo seleccionado." } }, "required": [ "model", "messages", "max_tokens" ] }, "AnthropicMessagesResponse": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "example": "message" }, "role": { "type": "string", "example": "assistant" }, "content": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "model": { "type": "string" }, "usage": { "$ref": "#/components/schemas/TokenUsage" } }, "required": [ "id", "type", "role", "content", "model" ] }, "GeminiGenerateContentRequest": { "type": "object", "properties": { "contents": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" }, "parts": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "required": [ "parts" ] } }, "generationConfig": { "type": "object", "description": "Configuración de generación. Además: llamar a :streamGenerateContent (en lugar de :generateContent) permite obtener un flujo SSE de Gemini.", "properties": { "temperature": { "type": "number", "minimum": 0, "maximum": 2 }, "topP": { "type": "number" }, "topK": { "type": "integer" }, "maxOutputTokens": { "type": "integer", "description": "Máximo de tokens de razonamiento y respuesta final combinados. Se aplican límites por modelo; agotar el presupuesto puede dejar la respuesta incompleta." }, "stopSequences": { "type": "array", "items": { "type": "string" } }, "responseMimeType": { "type": "string", "description": "P. ej. 'application/json' para salida estructurada." }, "responseSchema": { "type": "object", "additionalProperties": true, "description": "JSON Schema para salida estructurada (junto con responseMimeType application/json)." }, "responseModalities": { "type": "array", "items": { "type": "string" }, "description": "Incluye 'IMAGE' para devolver resultados de generación de imágenes." }, "thinkingConfig": { "type": "object", "additionalProperties": true, "description": "Controles nativos de pensamiento de Gemini. Gemini 3 utiliza thinkingLevel y Gemini 2.5 thinkingBudget; los valores y presupuestos dependen del modelo. No combines effort explícito con thinkingLevel o thinkingBudget nativos: se devuelve 400 incluso si los ajustes son equivalentes. includeThoughts por sí solo puede combinarse con effort.", "properties": { "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high" ], "description": "Nivel de pensamiento de Gemini 3. Los niveles dependen del modelo; none no se admite." }, "thinkingBudget": { "type": "integer", "minimum": -1, "description": "Presupuesto de tokens de pensamiento de Gemini 2.5. Si el modelo lo admite, -1 indica pensamiento dinámico y 0 lo desactiva. Gemini 2.5 Pro no permite desactivarlo." }, "includeThoughts": { "type": "boolean" } } } }, "additionalProperties": true }, "tools": { "type": "array", "description": "Declaraciones de herramientas con functionDeclarations.", "items": { "type": "object", "additionalProperties": true } }, "systemInstruction": { "type": "object", "additionalProperties": true, "description": "Instrucción del sistema, como objeto Content de Gemini ({ parts: [{ text }] })." } }, "required": [ "contents" ] }, "GeminiGenerateContentResponse": { "type": "object", "properties": { "candidates": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "usageMetadata": { "type": "object", "additionalProperties": true } }, "required": [ "candidates" ] }, "ImageGenerationRequest": { "oneOf": [ { "$ref": "#/components/schemas/GPTImage2GenerationRequest" }, { "$ref": "#/components/schemas/GPTImage25GenerationRequest" }, { "$ref": "#/components/schemas/GPTImage26GenerationRequest" }, { "$ref": "#/components/schemas/GenericImageGenerationRequest" }, { "$ref": "#/components/schemas/GrokImageGenerationRequest" } ] }, "GPTImage2GenerationRequest": { "type": "object", "properties": { "model": { "type": "string", "const": "gpt-image-2" }, "prompt": { "type": "string" }, "size": { "type": "string", "description": "Accepts auto, a positive WIDTHxHEIGHT target, or ratio shorthand such as 16:9. Every non-auto target is mapped to the nearest official popular size: 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160, or 2160x3840.", "examples": [ "auto", "1024x1024", "1280x720", "16:9" ] }, "quality": { "type": "string", "description": "GPT-Image 2 rendering quality.", "enum": [ "auto", "low", "medium", "high" ], "default": "auto" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "description": "Number of images to generate. Billing scales with the image count.", "default": 1 }, "aspect_ratio": { "type": "string", "description": "Deprecated ratio shorthand. The ratio and compatibility tier are mapped to the nearest official popular size.", "deprecated": true }, "resolution": { "type": "string", "description": "Deprecated compatibility tier used to form the target size before nearest-official-size mapping.", "enum": [ "1K", "2K", "4K" ], "deprecated": true }, "input_images": { "type": "array", "items": { "type": "string", "format": "uri" } }, "callback_url": { "type": "string", "format": "uri" } }, "required": [ "model", "prompt" ] }, "GPTImage25GenerationRequest": { "type": "object", "properties": { "model": { "type": "string", "enum": [ "gpt-image-2.5", "gpt-image-2.5-flare", "gpt-image-2.5-sunburst" ], "description": "The gpt-image-2.5 alias is fixed to Flare semantics. Use the explicit Sunburst ID for precision-focused workflows." }, "prompt": { "type": "string" }, "size": { "type": "string", "description": "Use auto, a W:H ratio, or a valid WIDTHxHEIGHT value. Explicit pixels are preserved and must match resolution; dimensions must use multiples of 16, 655,360–8,294,400 total pixels, a maximum edge of 3840, and a ratio no wider than 3:1.", "examples": ["auto", "1:1", "16:9", "2048x1152"] }, "resolution": { "type": "string", "enum": ["1K", "2K", "4K"], "default": "1K", "description": "Output resolution tier. This is independent from quality." }, "quality": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "default": "auto", "description": "Rendering effort. APIAny selects only routes that support the requested tier." }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "default": 1, "description": "Number of images. Requests above one image require a compatible route, and billing scales with n." }, "image_urls": { "type": "array", "maxItems": 16, "items": { "type": "string", "format": "uri" }, "description": "Optional reference images for editing or guided generation." }, "mask_url": { "type": "string", "format": "uri", "description": "Optional edit mask. Requires a model that supports masked image editing." }, "background": { "type": "string", "enum": ["auto", "opaque", "transparent"], "default": "auto" }, "output_format": { "type": "string", "enum": ["png", "jpeg", "webp"], "default": "png" }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Compression setting for JPEG or WebP output." }, "callback_url": { "type": "string", "format": "uri" } }, "required": ["model", "prompt"] }, "GPTImage26Parameters": { "type": "object", "description": "Use estos parámetros en el nivel superior o en model_params, sin valores contradictorios. Los controles no admitidos devuelven HTTP 400.", "properties": { "size": { "type": "string", "enum": [ "auto", "1:1", "3:2", "2:3", "1024x1024", "1536x1024", "1024x1536" ], "default": "auto", "description": "Tamaños 1K admitidos. Las dimensiones reales del GIF, el número de fotogramas y sus intervalos pueden variar y no se pueden configurar." }, "resolution": { "type": "string", "enum": [ "1K" ], "default": "1K" }, "quality": { "type": "string", "enum": [ "auto" ], "default": "auto" }, "output_format": { "type": "string", "enum": [ "png", "gif" ], "default": "png" }, "n": { "type": "integer", "const": 1, "default": 1 }, "image_urls": { "type": "array", "maxItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "Como máximo una imagen de referencia entre todos los campos de referencia. Es el límite actual de APIAny.AI para este modelo." }, "image": { "type": "string", "minLength": 1, "description": "Como máximo una imagen de referencia entre todos los campos de referencia. Es el límite actual de APIAny.AI para este modelo." }, "background": { "type": "string", "const": "auto" }, "aspect_ratio": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/size" }, "aspectRatio": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/size" }, "img_size": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/resolution" }, "imageSize": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/resolution" }, "image_size": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/resolution" }, "outputFormat": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/output_format" }, "format": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/output_format" }, "count": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/n" }, "num_images": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/n" }, "numImages": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/n" }, "images": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image_urls" }, "input_urls": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image_urls" }, "input_url": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image" }, "input_images": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image_urls" }, "input_image_urls": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image_urls" }, "reference_images": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image_urls" }, "reference_image_urls": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image_urls" }, "image_url": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image" }, "input_image": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image" }, "input_image_url": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image" }, "reference_image": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image" }, "reference_image_url": { "$ref": "#/components/schemas/GPTImage26Parameters/properties/image" } }, "not": { "anyOf": [ { "required": [ "frame_count" ] }, { "required": [ "frameCount" ] }, { "required": [ "frame_duration_ms" ] }, { "required": [ "frameDurationMs" ] }, { "required": [ "mask" ] }, { "required": [ "mask_url" ] }, { "required": [ "maskUrl" ] }, { "required": [ "masks" ] }, { "required": [ "output_compression" ] }, { "required": [ "outputCompression" ] } ] } }, "GPTImage26GenerationRequest": { "type": "object", "description": "Contrato público de solicitudes de GPT Image 2.6. Compruebe la disponibilidad con GET /v1/models antes de usarlo. Cada solicitud correcta devuelve una imagen PNG estática o un GIF animado descargable y cuesta 30 créditos en ambos formatos. PNG es el valor predeterminado. Solo se admiten 1K, quality=auto y n=1. No se admiten SVG, JPEG, WebP, máscaras, compresión de salida, frame_count ni frame_duration_ms. Los mismos límites se aplican a los alias de compatibilidad y a model_params; los valores contradictorios devuelven HTTP 400.", "allOf": [ { "$ref": "#/components/schemas/GPTImage26Parameters" } ], "properties": { "model": { "type": "string", "const": "gpt-image-2.6" }, "prompt": { "type": "string", "minLength": 1 }, "model_params": { "$ref": "#/components/schemas/GPTImage26Parameters" }, "callback_url": { "type": "string", "format": "uri" } }, "required": [ "model", "prompt" ] }, "GPTImage26EditRequest": { "allOf": [ { "$ref": "#/components/schemas/GPTImage26GenerationRequest" } ], "type": "object", "properties": { "image": { "type": "string", "format": "binary" } }, "required": [ "image" ] }, "GrokImageGenerationRequest": { "type": "object", "description": "Vista previa solo en dev. Estos modelos aún no están habilitados en producción. Usa la dirección de dev indicada abajo para las pruebas. `grok-imagine-image` genera una imagen por solicitud (`n: 1`). Envía solo texto para generar o una URL HTTPS pública en `image_urls` para editar. El endpoint de edición existente sigue disponible. Esta versión no admite máscaras, varias referencias, dimensiones personalizadas en píxeles ni niveles de calidad.", "properties": { "model": { "type": "string", "const": "grok-imagine-image" }, "prompt": { "type": "string", "minLength": 1 }, "n": { "type": "integer", "const": 1, "default": 1 }, "size": { "type": "string", "enum": [ "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3" ], "default": "1:1" }, "response_format": { "type": "string", "const": "url", "default": "url" }, "image_urls": { "type": "array", "maxItems": 1, "items": { "type": "string", "format": "uri", "pattern": "^https://" } }, "callback_url": { "type": "string", "format": "uri" } }, "required": [ "model", "prompt" ] }, "GenericImageGenerationRequest": { "type": "object", "properties": { "model": { "type": "string", "not": { "enum": [ "gpt-image-2", "gpt-image-2.5", "gpt-image-2.5-flare", "gpt-image-2.5-sunburst", "gpt-image-2.6", "grok-imagine-image" ] }, "example": "nano-banana" }, "prompt": { "type": "string" }, "size": { "type": "string", "description": "Model-specific image size or aspect ratio shorthand.", "example": "1k" }, "input_images": { "type": "array", "items": { "type": "string", "format": "uri" } }, "callback_url": { "type": "string", "format": "uri" } }, "required": [ "model", "prompt" ] }, "ImageEditRequest": { "oneOf": [ { "$ref": "#/components/schemas/GPTImage26EditRequest" }, { "$ref": "#/components/schemas/GenericImageEditRequest" } ] }, "GenericImageEditRequest": { "type": "object", "properties": { "model": { "type": "string", "example": "nano-banana", "not": { "const": "gpt-image-2.6" } }, "prompt": { "type": "string" }, "image": { "type": "string", "format": "binary" }, "mask": { "type": "string", "format": "binary" }, "size": { "type": "string", "example": "1k" } }, "required": [ "model", "prompt", "image" ] }, "VideoGenerationRequest": { "oneOf": [ { "$ref": "#/components/schemas/GeneralVideoGenerationRequest" }, { "$ref": "#/components/schemas/GrokVideoGenerationRequest" } ] }, "GrokVideoGenerationRequest": { "type": "object", "description": "Vista previa solo en dev. Estos modelos aún no están habilitados en producción. Usa la dirección de dev indicada abajo para las pruebas. `grok-imagine-video-1.5` admite una `duration` entera de 1 a 15 segundos (8 por defecto), `resolution` de `480p` por defecto, `720p` o `1080p`, y como máximo una imagen. Omite `image_urls` para texto a vídeo. Con una imagen se conserva su proporción; `aspect_ratio` no la cambia.", "properties": { "model": { "type": "string", "const": "grok-imagine-video-1.5" }, "prompt": { "type": "string", "minLength": 1 }, "duration": { "type": "integer", "minimum": 1, "maximum": 15, "default": 8 }, "resolution": { "type": "string", "enum": [ "480p", "720p", "1080p" ], "default": "480p" }, "aspect_ratio": { "type": "string", "enum": [ "16:9", "1:1", "9:16", "4:3", "3:4", "3:2", "2:3", "21:9", "5:2" ], "default": "16:9" }, "image_urls": { "type": "array", "maxItems": 1, "items": { "type": "string", "format": "uri", "pattern": "^https://" } }, "callback_url": { "type": "string", "format": "uri" } }, "required": [ "model", "prompt" ] }, "GeneralVideoGenerationRequest": { "type": "object", "properties": { "model": { "type": "string", "example": "seedance-2.0", "examples": [ "wan3.0-prime-text-to-video", "wan3.0-prime-image-to-video", "wan3.0-prime-reference-video" ], "not": { "const": "grok-imagine-video-1.5" } }, "prompt": { "type": "string" }, "duration": { "type": [ "integer", "string" ], "example": 5, "description": "Output duration. Wan 3.0 Prime requires an integer from 2 to 30 seconds." }, "resolution": { "type": "string", "example": "720p", "description": "Resolution or quality alias." }, "quality": { "type": "string", "enum": [ "480p", "720p", "1080p" ], "description": "Wan 3.0 Prime output quality." }, "ratio": { "type": "string", "example": "16:9" }, "aspect_ratio": { "type": "string", "enum": [ "adaptive", "16:9", "9:16", "1:1", "4:3", "3:4" ], "description": "Wan 3.0 Prime output aspect ratio." }, "generate_audio": { "type": "boolean", "default": true, "description": "Request synchronized audio when the selected model supports it." }, "image_start": { "type": "string", "format": "uri", "description": "Required first frame for wan3.0-prime-image-to-video." }, "image_end": { "type": "string", "format": "uri", "description": "Optional final frame for wan3.0-prime-image-to-video." }, "image_urls": { "type": "array", "maxItems": 10, "items": { "type": "string", "format": "uri" }, "description": "Ordered image references for wan3.0-prime-reference-video." }, "video_urls": { "type": "array", "maxItems": 5, "items": { "type": "string", "format": "uri" }, "description": "Ordered video references for wan3.0-prime-reference-video." }, "audio_urls": { "type": "array", "maxItems": 5, "items": { "type": "string", "format": "uri" }, "description": "Ordered audio references for wan3.0-prime-reference-video." }, "model_params": { "type": "object", "description": "Optional Wan 3.0 Prime reference context. file_url and link_url are mutually exclusive.", "properties": { "file_url": { "type": "string", "format": "uri", "description": "One reference document URL." }, "link_url": { "type": "string", "format": "uri", "description": "One reference web page URL." } } }, "input_images": { "type": "array", "items": { "type": "string", "format": "uri" } }, "input_videos": { "type": "array", "items": { "type": "string", "format": "uri" } }, "input_audio": { "type": "array", "items": { "type": "string", "format": "uri" } }, "callback_url": { "type": "string", "format": "uri" } }, "required": [ "model", "prompt" ] }, "AsyncTaskCreateResponse": { "type": "object", "properties": { "task_id": { "type": "string", "example": "task_123" }, "status": { "type": "string", "enum": [ "pending", "processing" ] }, "model": { "type": "string" }, "poll_url": { "type": "string", "example": "/v1/tasks/task_123" } }, "required": [ "task_id", "status", "poll_url" ] }, "TaskResponse": { "type": "object", "properties": { "task_id": { "type": "string", "example": "task_123" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed", "expired" ] }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "completed_at": { "type": [ "string", "null" ], "format": "date-time" }, "result": { "oneOf": [ { "$ref": "#/components/schemas/MediaResult" }, { "type": "null" } ] }, "error": { "oneOf": [ { "$ref": "#/components/schemas/ErrorResponse/properties/error" }, { "type": "null" } ] } }, "required": [ "task_id", "status" ] }, "MediaResult": { "description": "Resultado de la tarea completada. Las tareas de imagen usan el formato de imagen de OpenAI (la URL de la imagen está en data[0].url); las tareas de vídeo y audio exponen video_url/audio_url junto con un array urls[].", "oneOf": [ { "$ref": "#/components/schemas/ImageTaskResult" }, { "$ref": "#/components/schemas/MediaUrlResult" } ] }, "ImageTaskResult": { "type": "object", "description": "Resultado de la tarea de imagen (formato de imagen de OpenAI); la URL de la imagen está en data[0].url.", "properties": { "created": { "type": "integer" }, "data": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "b64_json": { "type": "string" }, "revised_prompt": { "type": "string" } } } } }, "required": [ "data" ] }, "MediaUrlResult": { "type": "object", "description": "Resultado de la tarea de vídeo o audio. La URL principal es video_url o audio_url; todos los productos se listan además en urls[].", "properties": { "status": { "type": "string" }, "video_url": { "type": "string", "format": "uri" }, "audio_url": { "type": "string", "format": "uri" }, "output_url": { "type": "string", "format": "uri" }, "urls": { "type": "array", "items": { "type": "string", "format": "uri" } } } }, "OpenAIImageResponse": { "type": "object", "properties": { "created": { "type": "integer" }, "data": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "b64_json": { "type": "string" }, "revised_prompt": { "type": "string" } } } }, "usage": { "$ref": "#/components/schemas/TokenUsage" } }, "required": [ "created", "data" ] }, "TokenUsage": { "type": "object", "properties": { "prompt_tokens": { "type": "integer" }, "completion_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "cached_input_tokens": { "type": "integer" } }, "additionalProperties": true }, "ModerationRequest": { "type": "object", "properties": { "model": { "type": "string", "example": "nsfw-image-detection" }, "image_url": { "type": "string", "format": "uri", "description": "Image URL to classify." }, "input": { "type": "object", "properties": { "image": { "type": "string", "format": "uri", "description": "Alternative nested image URL." } } } }, "required": [ "model" ], "anyOf": [ { "required": [ "image_url" ] }, { "required": [ "input" ] } ] }, "ModerationResponse": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string", "example": "moderation" }, "model": { "type": "string", "example": "nsfw-image-detection" }, "created": { "type": [ "string", "integer", "null" ] }, "results": { "type": "array", "items": { "type": "object", "properties": { "flagged": { "type": "boolean" }, "label": { "type": "string", "example": "normal" }, "score": { "type": "number", "minimum": 0, "maximum": 1 } }, "required": [ "flagged", "label" ] } } }, "required": [ "object", "model", "results" ] }, "IpGeoResponse": { "type": "object", "properties": { "object": { "type": "string", "example": "ip_geo" }, "request_id": { "type": "string", "example": "req_123" }, "data": { "type": "object", "properties": { "ip": { "type": "string", "example": "8.8.8.8" }, "country": { "type": "string", "example": "US" }, "region": { "type": "string", "example": "California" }, "city": { "type": "string", "example": "Mountain View" }, "source": { "type": "string", "example": "maxmind-city" } }, "required": [ "ip", "country", "region", "city", "source" ] } }, "required": [ "object", "request_id", "data" ] } } } }