Skip to content
Changelog

Report a bug

Kieai integration: operations for AI agents

Kieai connects to Type.com as an integration. This page lists the 27 operations documented for Claude and Codex in Type.com: 3 read, 24 write.

About Kieai

AI API platform providing video generation (Veo3, Kling, Runway, Luma), image generation (Flux, Nano Banana), music creation (Suno), and LLM capabilities with pay-as-you-go pricing

Categories: Developer Tools & IT

How to connect Kieai to Type.com

Access
Organization connection: one shared account for the workspace.
MCP
This integration is not available through Type’s MCP server. It remains available in Type.

To add the connection, follow the steps in Space connections.

Documented operations

27 operations. Your connection's permissions determine which operations are available. API references describe the vendor surface; they do not expand your connection's credentials or access.

27 operations listed.

Generation tasks

  • Read

    Get Task Details

    Query the status and results of any task created in the Market models. This is a unified query interface that works with all models under the Market category. Supported Models Works for every task created via POST /api/v1/jobs/createTask. Chat models are synchronous and have no task to query. Task States - waiting: Task is queued and waiting to be processed - queuing: Task is in the processing queue - generating: Task is currently being processed - success: Task completed successfully - fail: Task failed Best Practices - Use callbacks for production: Include callBackUrl when creating tasks to avoid polling - Implement exponential backoff: Start with 2-3 second intervals, increase gradually - Long-running tasks: Some video tasks take longer than 10 minutes. Keep polling until state is success or fail. - Download results: Generated files are kept for 14 days. Errors Errors are returned with HTTP 200; check code. Common values: 401 invalid or missing API key; 422 taskId is missing, or the task does not exist or does not belong to your account.

    GET /api/v1/jobs/recordInfo

  • Write

    Create AI generation task

    Submit a generation request through this shared POST route. The official reference documents 192 request/model variants with different model identifiers and input schemas; use the linked model reference for required inputs. Documented model identifiers: 4o-image-api, flux1-kontext, bytedance/seedance-2-5-draft, bytedance/seedance-2-5, bytedance/seedance-2-fast, bytedance/seedance-2-mini, bytedance/seedance-2, bytedance/v1-lite-image-to-video, bytedance/v1-lite-text-to-video, bytedance/v1-pro-fast-image-to-video, bytedance/v1-pro-image-to-video, bytedance/v1-pro-text-to-video, elevenlabs/audio-isolation, elevenlabs/text-to-dialogue-v3, elevenlabs/text-to-speech-multilingual-v2, elevenlabs/text-to-speech-turbo-2-5, flux-2/flex-image-to-image, flux-2/flex-text-to-image, flux-2/pro-image-to-image, flux-2/pro-text-to-image, flux-3/klein-edit-image, flux-3/klein-text-to-image, gemini-omni-video, google/gemini-2-5-pro-tts, google/gemini-3-1-flash-tts, google/gemini-3-8-flash-lite-tts, google/gemini-3-8-flash-tts, google/gemini-omni-flash-1-1, google/imagen4-fast, google/imagen4-ultra, google/imagen4, nano-banana-2-lite, google/nano-banana-edit, google/nano-banana, nano-banana-2-1, nano-banana-2, nano-banana-pro, gpt-image/1.5-image-to-image, gpt-image/1.5-text-to-image, gpt-image-2-5-flare-image-to-image, gpt-image-2-5-flare-text-to-image, gpt-image-2-5-sunburst-image-to-image, gpt-image-2-5-sunburst-text-to-image, gpt-image-2-image-to-image, gpt-image-2-text-to-image, grok-imagine-image-2-0/segment-edit, grok-imagine-image-2-0/image-edit, grok-imagine-image-2-0/segment-map, grok-imagine-image-2-0/text-to-image, grok-imagine-video-1-5-preview, grok-imagine/extend, grok-imagine/image-to-image, grok-imagine/image-to-video, grok-imagine/text-to-image, grok-imagine/text-to-video, grok-imagine/upscale, hailuo/02-image-to-video-pro, hailuo/02-image-to-video-standard, hailuo/02-text-to-video-pro, hailuo/02-text-to-video-standard, hailuo/2-3-image-to-video-pro, hailuo/2-3-image-to-video-standard, happyhorse-1-1/image-to-video, happyhorse-1-1/reference-to-video, happyhorse-1-1/text-to-video, happyhorse/image-to-video, happyhorse/reference-to-video, happyhorse/text-to-video, happyhorse/video-edit, ideogram/character-edit, ideogram/character-remix, ideogram/character, ideogram/v3-edit, ideogram/v3-remix, ideogram/v3-text-to-image, infinitalk/from-audio, kling/ai-avatar-pro, kling/ai-avatar-standard, kling-2.6/image-to-video, kling-3.0/video, kling-3.0/motion-control, kling-2.6/motion-control, kling-2.6/text-to-video, kling/v2-1-master-image-to-video, kling/v2-1-master-text-to-video, kling/v2-1-pro, kling/v2-1-standard, kling/v2-5-turbo-image-to-video-pro, kling/v2-5-turbo-text-to-video-pro, kling-3.0-omni/image-to-video, kling-3.0-omni/reference-to-video, kling-3.0-omni/text-to-video, kling-3.0-omni/transformation, kling/v3-turbo-image-to-video, kling/v3-turbo-text-to-video, kling-4.0/keyframe-to-video, kling-4.0/reference-to-video, minimax-h3/image-to-video, minimax-h3/reference-to-video, minimax-h3/text-to-video, omnihuman-1-5, omnihuman-1-5/human-identification, omnihuman-1-5/subject-detection, omnihuman-2-0, pixverse-v6/extend, pixverse-v6/image-to-video, pixverse-v6/reference-to-video, pixverse-v6/text-to-video, pixverse-v6/transition, pixverse-v6-max/image-to-video, pixverse-v6-max/text-to-video, qwen/image-edit, qwen/image-to-image, qwen/text-to-image, qwen2-1/image-to-image, qwen2-1/text-to-image, qwen2/image-edit, qwen2/text-to-image, qwen3/pro-image-to-image, qwen3/pro-text-to-image, qwen3/image-to-image, qwen3/text-to-image, recraft/crisp-upscale, recraft/remove-background, seedream/5-lite-image-to-image, seedream/4.5-edit, seedream/4.5-text-to-image, seedream/5-flash-image-to-image, seedream/5-flash-layer-decomposition, seedream/5-flash-text-to-image, seedream/5-lite-text-to-image, seedream/5-pro-image-to-image, seedream/5-pro-layer-decomposition, seedream/5-pro-text-to-image, bytedance/seedream-v4-edit, bytedance/seedream-v4-text-to-image, bytedance/seedream, topaz/image-upscale, topaz/video-upscale, vidu-q4/image-to-video, vidu-q4/reference-to-video, volcengine/video-to-video-lip-sync, wan/2-2-a14b-image-to-video-turbo, wan/2-2-a14b-speech-to-video-turbo, wan/2-2-a14b-text-to-video-turbo, wan/2-2-animate-move, wan/2-2-animate-replace, wan/2-5-image-to-video, wan/2-5-text-to-video, wan/2-6-flash-image-to-video, wan/2-6-flash-video-to-video, wan/2-6-image-to-video, wan/2-6-text-to-video, wan/2-6-video-to-video, wan/2-7-image-pro, wan/2-7-image-to-video, wan/2-7-image, wan/2-7-r2v, wan/2-7-text-to-video, wan/2-7-videoedit, wan/3-0-video-prime, wan/3-0-video, z-image, runway/extend-ai-video, runway, runway/gen4-aleph, ai-music-api/add-instrumental, ai-music-api/add-vocals, ai-music-api/boost-music-style, ai-music-api/convert-to-wav-format, ai-music-api/create-music-video, ai-music-api/extend, ai-music-api/generate-lyrics, ai-music-api/mashup, ai-music-api/generate-midi-from-audio, ai-music-api/generate, ai-music-api/generate-persona, ai-music-api/sounds, ai-music-api/timeStamped-lyrics, ai-music-api/suno-recovery-audio, ai-music-api/replace-section, ai-music-api/separate-vocals, ai-music-api/check-voice, ai-music-api/create-voice, ai-music-api/regenerate-phrase, ai-music-api/validation-phrase, ai-music-api/upload-and-cover-audio, ai-music-api/upload-and-extend-audio, veo/extend, veo-3-1, veo/get-1080p-video, veo/get-4k-video. Vendor marks the elevenlabs/audio-isolation and Generate Aleph Video request variants deprecated; their presence in the model reference does not establish current availability.

    POST /api/v1/jobs/createTask

Generation and account

  • Read

    Get Download URL for Generated Files

    Get Download Link for Generated Files :::tip[] Convert generated file URLs into downloadable temporary links. Only supports files generated by kie.ai services. ::: Features Convert kie.ai generated file URLs into downloadable links Accepts file URLs from task results (such as resultUrls or audiourl). URLs from the File Upload API are not supported. Temporary download links are valid for 20 minutes Secure access to generated content Protected by API Key authentication Important Notes :::warning[] Accepts file URLs from task results (such as resultUrls or audiourl). URLs from the File Upload API are not supported. ::: :::tip[] Downloadable links expire after 20 minutes. Please ensure you download or cache content within this timeframe. :::

    POST /api/v1/common/download-url

  • Read

    Get Remaining Credits

    :::tip[] Get the current credit balance available in your account. ::: Usage Guide Use this interface to check your current credit balance Monitor usage to ensure sufficient credits to continue using services Plan credit replenishment based on usage patterns Developer Notes All generation services require credit balance Service access will be restricted when credits are exhausted Credit consumption is based on specific services and usage volume

    GET /api/v1/chat/credit

  • Write

    GPT 5.2

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: GPT-5-2 API is a next-generation multimodal model with exceptional reasoning capabilities, supporting text and image inputs with Web Search grounding and adjustable reasoning effort. Supports text and image inputs Web search grounding enabled Adjustable reasoning effort level Multiple message roles supported Unified Media File Format :::caution In the messages parameter's content array, only images are supported. All image files use the same format structure: - The type field is always "imageurl" - The imageurl field name remains unchanged - The only thing that changes is the url value, which points to the corresponding image address For example: { type: 'imageurl', imageurl: { url: '...' } } structure. ::: Tools Parameter The tools parameter is an optional array that allows you to enable Web Search grounding. Web Search Use this format to enable Web Search grounding: json { "type": "function", "function": { "name": "websearch" } } This enables real-time information retrieval via Web Search. Response Example json { "id": "chatcmpl-example-123", "object": "chat.completion", "created": 1741569952, "model": "gpt-5-2", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "hello,can i help you?", "refusal": null, "annotations": [] }, "logprobs": null, "finishreason": "stop" } ], "usage": { "prompttokens": 10, "completiontokens": 50, "totaltokens": 60 } } Error handling Check the response body, not only the HTTP status. Errors are returned either as {"code": ..., "msg": "..."} (for example 401 invalid API key, 402 insufficient credits, 429 rate limited; the HTTP status may still be 200) or as {"error": {"type": "...", "message": "..."}}.

    POST /gpt-5-2/v1/chat/completions

  • Write

    Generate Codex Responses result

    Submit a generation request through this shared POST route. The official reference documents 10 request/model variants with different model identifiers and input schemas; use the linked model reference for required inputs. Documented model identifiers: gpt-5-5, gpt-5-6-luna, gpt-5-6-sol, gpt-5-6-terra, gpt-6-1-sol, gpt-6-1-terra, gpt-6-astra, gpt-6-luna, gpt-6-sol.

    POST /codex/v1/responses

  • Write

    Generate Claude Messages response

    Submit a generation request through this shared POST route. The official reference documents 13 request/model variants with different model identifiers and input schemas; use the linked model reference for required inputs. Documented model identifiers: claude-fable-5, claude-haiku-4-5, claude-haiku-5-5, claude-opus-4-5, claude-opus-4-6, claude-opus-4-7, claude-opus-4-8, claude-opus-5-5, claude-opus-5, claude-sonnet-4-5, claude-sonnet-4-6, claude-sonnet-5-5, claude-sonnet-5.

    POST /claude/v1/messages

  • Write

    Generate Responses result

    Submit a generation request through this shared POST route. The official reference documents 2 request/model variants with different model identifiers and input schemas; use the linked model reference for required inputs. Documented model identifiers: deepseek-v4-1-flash, kimi-k3.

    POST /openai/v1/responses

  • Write

    Gemini Omni Audio

    Synchronous. Registers a voice preset and returns data.audioId immediately; no audio file is generated. Pass audioId in audioids of the video and character endpoints. Returns data.audioId. Pass it in audioids of gemini-omni-video, google/gemini-omni-flash-1-1 and gemini-omni-character. :::tip This endpoint is free. ::: Related Resources Explore all available models and capabilities Check account credits and usage

    POST /api/v1/omni/audio/create

  • Write

    Gemini Omni Character

    - imageurls supports 1–2 images (index 0 portrait, index 1 optional full-body), each up to 20MB. - audioids must come from the gemini-omni-audio endpoint Create Task Use this endpoint to create a new character. :::tip This endpoint is free. ::: Related Resources Explore all available models and capabilities Check account credits and usage

    POST /api/v1/omni/character/create

  • Write

    Gemini 2.5 Pro (openai) (deprecated)

    :::warning ⚠️ No longer available Gemini 2.5 Pro has been retired upstream and is no longer available on Kie.ai. Requests to this endpoint return an error (response code: 410) and are not charged. Please consider other models in the Gemini series — the latest is Gemini 4 Argon. ::: :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application. Streaming Response Format: - Content-Type: text/event-stream - Each event line starts with data: followed by JSON - Events contain incremental message deltas - Final event indicates completion with finishreason - The stream ends with a chunk carrying usage and creditsconsumed, followed by data: [DONE]. Text, image, video, audio and PDF input Google Search grounding enabled Server-sent events support Multiple message roles supported ⚠️ Important: Unified Media Structure To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure : The type field is fixed as "imageurl" The imageurl key name remains unchanged for all file types Only the url value points to your specific media file // Example for Video/Audio/PDF/Image: { "type": "imageurl", "imageurl": { "url": "https://..." } } Tools Parameter The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array. Use this format to enable Google Search grounding: json { "type": "function", "function": { "name": "googleSearch" } } This enables real-time information retrieval via Google Search. Define your own functions with parameters. You can define multiple functions in the tools array: json [ { "type": "function", "function": { "name": "getcurrentweather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } }, { "type": "function", "function": { "name": "getstockprice", "description": "Get the current stock price for a given symbol", "parameters": { "type": "object", "properties": { "symbol": { "type": "string", "description": "The stock symbol, e.g. AAPL" } }, "required": ["symbol"] } } } ] Function Declaration Requirements When implementing function calling in your prompt, you need to create a tools array containing one or more function declarations. You can define functions using JSON (specifically, a selected subset of OpenAPI schema format). A single function declaration can include the following parameters: - name (string, required): The unique name of the function (e.g., getweatherforecast, sendemail). Use descriptive names without spaces or special characters (use underscores or camelCase). - description (string, optional but recommended): A clear and detailed description of what the function does and its purpose. This is crucial for the model to understand when to use the function. Be specific and provide examples when necessary (e.g., "Find movie theaters by location, with an option to also find movies currently showing at those theaters."). - parameters (object, required): Defines the input parameters expected by the function. Contains: - type (string): Specifies the overall data type, must be "object". - properties (object): Lists individual parameters, each with: - type (string): The parameter's data type, such as string, integer, boolean, array. - description (string): Description of the parameter's purpose and format. Provide examples and constraints (e.g., "City and state, e.g. 'San Francisco, CA' or a postal code like '95616'."). - enum (array, optional): If parameter values come from a fixed set, use enum to list allowed values rather than just describing them in the description. This helps improve accuracy (e.g., "enum": ["daylight", "cool", "warm"]). - required (array): An array of strings listing the parameter names required for the function to run. Response Format Parameter The responseformat parameter is an optional JSON Schema object that defines the structure of the response. When provided, the model will generate responses that conform to this schema. The responseformat follows the JSON Schema specification. Supported types include: - string: For text values - number: For floating-point numbers - integer: For whole numbers - boolean: For true/false values - object: For structured data with key-value pairs - array: For lists of items - null: To allow null values, add "null" to the type array (e.g., {"type": ["string", "null"]}) Type-Specific Properties For object values: - properties: Object mapping property names to their schema definitions - required: Array of required property names - additionalProperties: Controls whether properties not in properties are allowed For string values: - enum: List of specific possible string values for classification - format: Specifies string syntax (e.g., date-time, date, time) For number and integer values: - enum: List of specific possible numeric values - minimum: Inclusive minimum value - maximum: Inclusive maximum value For array values: - items: Schema definition for all array elements - prefixItems: List of schemas for the first N items (tuple-like structures) - minItems: Minimum number of items in the array - maxItems: Maximum number of items in the array json { "responseformat": { "type": "jsonschema", "jsonschema": { "name": "structuredoutput", "strict": true, "schema": { "type": "object", "properties": { "response": { "type": "string" } }, "required": [ "response" ] } } } } {"type":"jsonobject"} is also supported. - Clear descriptions: Use the description field in the schema to clearly explain what each property means - Strong typing: Use specific types (integer, string, enum) whenever possible - Prompt engineering: Clearly state in your prompt what you want the model to extract or structure - Validation: While structured output ensures JSON is syntactically correct, always validate the semantic correctness of values in your application code Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini-2.5-pro/v1/chat/completions

  • Write

    Gemini 3.1 Pro (openai)

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application. Streaming Response Format: - Content-Type: text/event-stream - Each event line starts with data: followed by JSON - Events contain incremental message deltas - Final event indicates completion with finishreason - The stream ends with a chunk carrying usage and creditsconsumed, followed by data: [DONE]. Text, image, video, audio and PDF input Google Search grounding enabled Server-sent events support Multiple message roles supported ⚠️ Important: Unified Media Structure To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure : The type field is fixed as "imageurl" The imageurl key name remains unchanged for all file types Only the url value points to your specific media file // Example for Video/Audio/PDF/Image: { "type": "imageurl", "imageurl": { "url": "https://..." } } Tools Parameter The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array. Use this format to enable Google Search grounding: json { "type": "function", "function": { "name": "googleSearch" } } This enables real-time information retrieval via Google Search. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini-3.1-pro/v1/chat/completions

  • Write

    Gemini 3.5 Flash (openai) (deprecated)

    :::warning ⚠️ No longer available Gemini 3.5 Flash has been deprecated by Google and is no longer available on Kie.ai. Requests to this endpoint will fail. Please switch to Gemini 3.6 Flash or Gemini 3.8 Flash (same price). ::: :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: The model is selected by the URL path. Streaming Support When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application. Streaming Response Format: - Content-Type: text/event-stream - Each event line starts with data: followed by JSON - Events contain incremental message deltas - Final event indicates completion with finishreason - The stream ends with a chunk carrying usage and creditsconsumed, followed by data: [DONE]. Text, image, video, audio and PDF input Google Search grounding enabled Server-sent events support Multiple message roles supported ⚠️ Important: Unified Media Structure To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure : The type field is fixed as "imageurl" The imageurl key name remains unchanged for all file types Only the url value points to your specific media file // Example for Video/Audio/PDF/Image: { "type": "imageurl", "imageurl": { "url": "https://..." } } Tools Parameter The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array. Define your own functions with parameters. You can define multiple functions in the tools array: json [ { "type": "function", "function": { "name": "getcurrentweather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } }, { "type": "function", "function": { "name": "getstockprice", "description": "Get the current stock price for a given symbol", "parameters": { "type": "object", "properties": { "symbol": { "type": "string", "description": "The stock symbol, e.g. AAPL" } }, "required": ["symbol"] } } } ] Function Declaration Requirements When implementing function calling in your prompt, you need to create a tools array containing one or more function declarations. You can define functions using JSON (specifically, a selected subset of OpenAPI schema format). A single function declaration can include the following parameters: - name (string, required): The unique name of the function (e.g., getweatherforecast, sendemail). Use descriptive names without spaces or special characters (use underscores or camelCase). - description (string, optional but recommended): A clear and detailed description of what the function does and its purpose. This is crucial for the model to understand when to use the function. Be specific and provide examples when necessary (e.g., "Find movie theaters by location, with an option to also find movies currently showing at those theaters."). - parameters (object, required): Defines the input parameters expected by the function. Contains: - type (string): Specifies the overall data type, must be "object". - properties (object): Lists individual parameters, each with: - type (string): The parameter's data type, such as string, integer, boolean, array. - description (string): Description of the parameter's purpose and format. Provide examples and constraints (e.g., "City and state, e.g. 'San Francisco, CA' or a postal code like '95616'."). - enum (array, optional): If parameter values come from a fixed set, use enum to list allowed values rather than just describing them in the description. This helps improve accuracy (e.g., "enum": ["daylight", "cool", "warm"]). - required (array): An array of strings listing the parameter names required for the function to run. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini-3-5-flash-openai/v1/chat/completions

  • Write

    Gemini 3.5 Flash (deprecated)

    :::warning ⚠️ No longer available Gemini 3.5 Flash has been deprecated by Google and is no longer available on Kie.ai. Requests to this endpoint will fail. Please switch to Gemini 3.6 Flash or Gemini 3.8 Flash (same price). ::: :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support The Gemini endpoint returns streaming chunks from streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall. Streaming Response Format: - Content-Type: text/event-stream. The last data chunk carries usageMetadata and creditsconsumed, followed by data: [DONE]. - Function calls are returned inside parts[].functionCall - Thinking output may be reflected through thoughtSignature and usage metadata Features - Standard chat with contents. - Google Search grounding with googleSearch. - Function calling with functionDeclarations. - Thinking configuration with generationConfig.thinkingConfig. Request Notes - Use contents as the primary conversation input. - Use tools.googleSearch to enable Google Search grounding. - Use tools.functionDeclarations to define callable functions. - Use generationConfig.thinkingConfig to control thoughts output and thinking level. Authentication Authentication: send your KIE API key as Authorization: Bearer YOURAPIKEY. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini/v1/models/gemini-3-5-flash:streamGenerateContent

  • Write

    Gemini 3.6 Flash (openai)

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application. Streaming Response Format: - Content-Type: text/event-stream - Each event line starts with data: followed by JSON - Events contain incremental message deltas - Final event indicates completion with finishreason - The stream ends with a chunk carrying usage and creditsconsumed, followed by data: [DONE]. Text, image, video, audio and PDF input Google Search grounding enabled Server-sent events support Multiple message roles supported ⚠️ Important: Unified Media Structure To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure : The type field is fixed as "imageurl" The imageurl key name remains unchanged for all file types Only the url value points to your specific media file // Example for Video/Audio/PDF/Image: { "type": "imageurl", "imageurl": { "url": "https://..." } } Tools Parameter The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array. Define your own functions with parameters. You can define multiple functions in the tools array: json [ { "type": "function", "function": { "name": "getcurrentweather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } }, { "type": "function", "function": { "name": "getstockprice", "description": "Get the current stock price for a given symbol", "parameters": { "type": "object", "properties": { "symbol": { "type": "string", "description": "The stock symbol, e.g. AAPL" } }, "required": ["symbol"] } } } ] Function Declaration Requirements When implementing function calling in your prompt, you need to create a tools array containing one or more function declarations. You can define functions using JSON (specifically, a selected subset of OpenAPI schema format). A single function declaration can include the following parameters: - name (string, required): The unique name of the function (e.g., getweatherforecast, sendemail). Use descriptive names without spaces or special characters (use underscores or camelCase). - description (string, optional but recommended): A clear and detailed description of what the function does and its purpose. This is crucial for the model to understand when to use the function. Be specific and provide examples when necessary (e.g., "Find movie theaters by location, with an option to also find movies currently showing at those theaters."). - parameters (object, required): Defines the input parameters expected by the function. Contains: - type (string): Specifies the overall data type, must be "object". - properties (object): Lists individual parameters, each with: - type (string): The parameter's data type, such as string, integer, boolean, array. - description (string): Description of the parameter's purpose and format. Provide examples and constraints (e.g., "City and state, e.g. 'San Francisco, CA' or a postal code like '95616'."). - enum (array, optional): If parameter values come from a fixed set, use enum to list allowed values rather than just describing them in the description. This helps improve accuracy (e.g., "enum": ["daylight", "cool", "warm"]). - required (array): An array of strings listing the parameter names required for the function to run. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini-3-6-flash-openai/v1/chat/completions

  • Write

    Gemini 3.6 Flash

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support The Gemini endpoint returns streaming chunks from streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall. Streaming Response Format: - Content-Type: text/event-stream. The last data chunk carries usageMetadata and creditsconsumed, followed by data: [DONE]. - Function calls are returned inside parts[].functionCall - Thinking output may be reflected through thoughtSignature and usage metadata Features - Standard chat with contents. - Google Search grounding with googleSearch. - Function calling with functionDeclarations. - Thinking configuration with generationConfig.thinkingConfig. Request Notes - Use contents as the primary conversation input. - Use tools.googleSearch to enable Google Search grounding. - Use tools.functionDeclarations to define callable functions. - Use generationConfig.thinkingConfig to control thoughts output and thinking level. Authentication Authentication: send your KIE API key as Authorization: Bearer YOURAPIKEY. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini/v1/models/gemini-3-6-flash:streamGenerateContent

  • Write

    Gemini 3.7 Flash (openai) (deprecated)

    :::warning ⚠️ Deprecated — auto-redirected Gemini 3.7 Flash has been deprecated by Google. Requests to this endpoint are now served by Gemini 3.8 Flash and billed at the same rate as Gemini 3.8 Flash. Please update your integration to Gemini 3.8 Flash. ::: :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application. Streaming Response Format: - Content-Type: text/event-stream - Each event line starts with data: followed by JSON - Events contain incremental message deltas - Final event indicates completion with finishreason - The stream ends with a chunk carrying usage and creditsconsumed, followed by data: [DONE]. Text, image, video, audio and PDF input Google Search grounding enabled Server-sent events support Multiple message roles supported ⚠️ Important: Unified Media Structure To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure : The type field is fixed as "imageurl" The imageurl key name remains unchanged for all file types Only the url value points to your specific media file // Example for Video/Audio/PDF/Image: { "type": "imageurl", "imageurl": { "url": "https://..." } } Tools Parameter The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array. Define your own functions with parameters. You can define multiple functions in the tools array: json [ { "type": "function", "function": { "name": "getcurrentweather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } }, { "type": "function", "function": { "name": "getstockprice", "description": "Get the current stock price for a given symbol", "parameters": { "type": "object", "properties": { "symbol": { "type": "string", "description": "The stock symbol, e.g. AAPL" } }, "required": ["symbol"] } } } ] Function Declaration Requirements When implementing function calling in your prompt, you need to create a tools array containing one or more function declarations. You can define functions using JSON (specifically, a selected subset of OpenAPI schema format). A single function declaration can include the following parameters: - name (string, required): The unique name of the function (e.g., getweatherforecast, sendemail). Use descriptive names without spaces or special characters (use underscores or camelCase). - description (string, optional but recommended): A clear and detailed description of what the function does and its purpose. This is crucial for the model to understand when to use the function. Be specific and provide examples when necessary (e.g., "Find movie theaters by location, with an option to also find movies currently showing at those theaters."). - parameters (object, required): Defines the input parameters expected by the function. Contains: - type (string): Specifies the overall data type, must be "object". - properties (object): Lists individual parameters, each with: - type (string): The parameter's data type, such as string, integer, boolean, array. - description (string): Description of the parameter's purpose and format. Provide examples and constraints (e.g., "City and state, e.g. 'San Francisco, CA' or a postal code like '95616'."). - enum (array, optional): If parameter values come from a fixed set, use enum to list allowed values rather than just describing them in the description. This helps improve accuracy (e.g., "enum": ["daylight", "cool", "warm"]). - required (array): An array of strings listing the parameter names required for the function to run. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini-3-7-flash-openai/v1/chat/completions

  • Write

    Gemini 3.7 Flash (deprecated)

    :::warning ⚠️ Deprecated — auto-redirected Gemini 3.7 Flash has been deprecated by Google. Requests to this endpoint are now served by Gemini 3.8 Flash and billed at the same rate as Gemini 3.8 Flash. Please update your integration to Gemini 3.8 Flash. ::: :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support The Gemini endpoint returns streaming chunks from streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall. Streaming Response Format: - Content-Type: text/event-stream. The last data chunk carries usageMetadata and creditsconsumed, followed by data: [DONE]. - Function calls are returned inside parts[].functionCall - Thinking output may be reflected through thoughtSignature and usage metadata Features - Standard chat with contents. - Google Search grounding with googleSearch. - Function calling with functionDeclarations. - Thinking configuration with generationConfig.thinkingConfig. Request Notes - Use contents as the primary conversation input. - Use tools.googleSearch to enable Google Search grounding. - Use tools.functionDeclarations to define callable functions. - Use generationConfig.thinkingConfig to control thoughts output and thinking level. Authentication Authentication: send your KIE API key as Authorization: Bearer YOURAPIKEY. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini/v1/models/gemini-3-7-flash:streamGenerateContent

  • Write

    Gemini 3.8 Flash (openai)

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application. Streaming Response Format: - Content-Type: text/event-stream - Each event line starts with data: followed by JSON - Events contain incremental message deltas - Final event indicates completion with finishreason - The stream ends with a chunk carrying usage and creditsconsumed, followed by data: [DONE]. Text, image, video, audio and PDF input Google Search grounding enabled Server-sent events support Multiple message roles supported ⚠️ Important: Unified Media Structure To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure : The type field is fixed as "imageurl" The imageurl key name remains unchanged for all file types Only the url value points to your specific media file // Example for Video/Audio/PDF/Image: { "type": "imageurl", "imageurl": { "url": "https://..." } } Tools Parameter The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array. Define your own functions with parameters. You can define multiple functions in the tools array: json [ { "type": "function", "function": { "name": "getcurrentweather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } }, { "type": "function", "function": { "name": "getstockprice", "description": "Get the current stock price for a given symbol", "parameters": { "type": "object", "properties": { "symbol": { "type": "string", "description": "The stock symbol, e.g. AAPL" } }, "required": ["symbol"] } } } ] Function Declaration Requirements When implementing function calling in your prompt, you need to create a tools array containing one or more function declarations. You can define functions using JSON (specifically, a selected subset of OpenAPI schema format). A single function declaration can include the following parameters: - name (string, required): The unique name of the function (e.g., getweatherforecast, sendemail). Use descriptive names without spaces or special characters (use underscores or camelCase). - description (string, optional but recommended): A clear and detailed description of what the function does and its purpose. This is crucial for the model to understand when to use the function. Be specific and provide examples when necessary (e.g., "Find movie theaters by location, with an option to also find movies currently showing at those theaters."). - parameters (object, required): Defines the input parameters expected by the function. Contains: - type (string): Specifies the overall data type, must be "object". - properties (object): Lists individual parameters, each with: - type (string): The parameter's data type, such as string, integer, boolean, array. - description (string): Description of the parameter's purpose and format. Provide examples and constraints (e.g., "City and state, e.g. 'San Francisco, CA' or a postal code like '95616'."). - enum (array, optional): If parameter values come from a fixed set, use enum to list allowed values rather than just describing them in the description. This helps improve accuracy (e.g., "enum": ["daylight", "cool", "warm"]). - required (array): An array of strings listing the parameter names required for the function to run. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini-3-8-flash-openai/v1/chat/completions

  • Write

    Gemini 3.8 Flash

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support The Gemini endpoint returns streaming chunks from streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall. Streaming Response Format: - Content-Type: text/event-stream. The last data chunk carries usageMetadata and creditsconsumed, followed by data: [DONE]. - Function calls are returned inside parts[].functionCall - Thinking output may be reflected through thoughtSignature and usage metadata Features - Standard chat with contents. - Google Search grounding with googleSearch. - Function calling with functionDeclarations. - Thinking configuration with generationConfig.thinkingConfig. Request Notes - Use contents as the primary conversation input. - Use tools.googleSearch to enable Google Search grounding. - Use tools.functionDeclarations to define callable functions. - Use generationConfig.thinkingConfig to control thoughts output and thinking level. Authentication Authentication: send your KIE API key as Authorization: Bearer YOURAPIKEY. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini/v1/models/gemini-3-8-flash:streamGenerateContent

  • Write

    Gemini 3 Pro (openai)

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application. Streaming Response Format: - Content-Type: text/event-stream - Each event line starts with data: followed by JSON - Events contain incremental message deltas - Final event indicates completion with finishreason - The stream ends with a chunk carrying usage and creditsconsumed, followed by data: [DONE]. Text, image, video, audio and PDF input Google Search grounding enabled Server-sent events support Multiple message roles supported ⚠️ Important: Unified Media Structure To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure : The type field is fixed as "imageurl" The imageurl key name remains unchanged for all file types Only the url value points to your specific media file // Example for Video/Audio/PDF/Image: { "type": "imageurl", "imageurl": { "url": "https://..." } } Tools Parameter The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array. Use this format to enable Google Search grounding: json { "type": "function", "function": { "name": "googleSearch" } } This enables real-time information retrieval via Google Search. Define your own functions with parameters. You can define multiple functions in the tools array: json [ { "type": "function", "function": { "name": "getcurrentweather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } }, { "type": "function", "function": { "name": "getstockprice", "description": "Get the current stock price for a given symbol", "parameters": { "type": "object", "properties": { "symbol": { "type": "string", "description": "The stock symbol, e.g. AAPL" } }, "required": ["symbol"] } } } ] Function Declaration Requirements When implementing function calling in your prompt, you need to create a tools array containing one or more function declarations. You can define functions using JSON (specifically, a selected subset of OpenAPI schema format). A single function declaration can include the following parameters: - name (string, required): The unique name of the function (e.g., getweatherforecast, sendemail). Use descriptive names without spaces or special characters (use underscores or camelCase). - description (string, optional but recommended): A clear and detailed description of what the function does and its purpose. This is crucial for the model to understand when to use the function. Be specific and provide examples when necessary (e.g., "Find movie theaters by location, with an option to also find movies currently showing at those theaters."). - parameters (object, required): Defines the input parameters expected by the function. Contains: - type (string): Specifies the overall data type, must be "object". - properties (object): Lists individual parameters, each with: - type (string): The parameter's data type, such as string, integer, boolean, array. - description (string): Description of the parameter's purpose and format. Provide examples and constraints (e.g., "City and state, e.g. 'San Francisco, CA' or a postal code like '95616'."). - enum (array, optional): If parameter values come from a fixed set, use enum to list allowed values rather than just describing them in the description. This helps improve accuracy (e.g., "enum": ["daylight", "cool", "warm"]). - required (array): An array of strings listing the parameter names required for the function to run. Response Format Parameter The responseformat parameter is an optional JSON Schema object that defines the structure of the response. When provided, the model will generate responses that conform to this schema. The responseformat follows the JSON Schema specification. Supported types include: - string: For text values - number: For floating-point numbers - integer: For whole numbers - boolean: For true/false values - object: For structured data with key-value pairs - array: For lists of items - null: To allow null values, add "null" to the type array (e.g., {"type": ["string", "null"]}) Type-Specific Properties For object values: - properties: Object mapping property names to their schema definitions - required: Array of required property names - additionalProperties: Controls whether properties not in properties are allowed For string values: - enum: List of specific possible string values for classification - format: Specifies string syntax (e.g., date-time, date, time) For number and integer values: - enum: List of specific possible numeric values - minimum: Inclusive minimum value - maximum: Inclusive maximum value For array values: - items: Schema definition for all array elements - prefixItems: List of schemas for the first N items (tuple-like structures) - minItems: Minimum number of items in the array - maxItems: Maximum number of items in the array json { "responseformat": { "type": "jsonschema", "jsonschema": { "name": "structuredoutput", "strict": true, "schema": { "type": "object", "properties": { "response": { "type": "string" } }, "required": [ "response" ] } } } } {"type":"jsonobject"} is also supported. - Clear descriptions: Use the description field in the schema to clearly explain what each property means - Strong typing: Use specific types (integer, string, enum) whenever possible - Prompt engineering: Clearly state in your prompt what you want the model to extract or structure - Validation: While structured output ensures JSON is syntactically correct, always validate the semantic correctness of values in your application code Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini-3-pro/v1/chat/completions

  • Write

    Gemini 4 Argon (openai)

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support When stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application. Streaming Response Format: - Content-Type: text/event-stream - Each event line starts with data: followed by JSON - Events contain incremental message deltas - Final event indicates completion with finishreason - The stream ends with a chunk carrying usage and creditsconsumed, followed by data: [DONE]. Text, image, video, audio and PDF input Google Search grounding enabled Server-sent events support Multiple message roles supported ⚠️ Important: Unified Media Structure To simplify integration, all media types (Images, Videos, Audio, or Documents) in the messages array share the exact same JSON structure : The type field is fixed as "imageurl" The imageurl key name remains unchanged for all file types Only the url value points to your specific media file // Example for Video/Audio/PDF/Image: { "type": "imageurl", "imageurl": { "url": "https://..." } } Tools Parameter The tools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects. When using function calling, you can define multiple functions in the array. Define your own functions with parameters. You can define multiple functions in the tools array: json [ { "type": "function", "function": { "name": "getcurrentweather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } }, { "type": "function", "function": { "name": "getstockprice", "description": "Get the current stock price for a given symbol", "parameters": { "type": "object", "properties": { "symbol": { "type": "string", "description": "The stock symbol, e.g. AAPL" } }, "required": ["symbol"] } } } ] Function Declaration Requirements When implementing function calling in your prompt, you need to create a tools array containing one or more function declarations. You can define functions using JSON (specifically, a selected subset of OpenAPI schema format). A single function declaration can include the following parameters: - name (string, required): The unique name of the function (e.g., getweatherforecast, sendemail). Use descriptive names without spaces or special characters (use underscores or camelCase). - description (string, optional but recommended): A clear and detailed description of what the function does and its purpose. This is crucial for the model to understand when to use the function. Be specific and provide examples when necessary (e.g., "Find movie theaters by location, with an option to also find movies currently showing at those theaters."). - parameters (object, required): Defines the input parameters expected by the function. Contains: - type (string): Specifies the overall data type, must be "object". - properties (object): Lists individual parameters, each with: - type (string): The parameter's data type, such as string, integer, boolean, array. - description (string): Description of the parameter's purpose and format. Provide examples and constraints (e.g., "City and state, e.g. 'San Francisco, CA' or a postal code like '95616'."). - enum (array, optional): If parameter values come from a fixed set, use enum to list allowed values rather than just describing them in the description. This helps improve accuracy (e.g., "enum": ["daylight", "cool", "warm"]). - required (array): An array of strings listing the parameter names required for the function to run. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini-4-argon-openai/v1/chat/completions

  • Write

    Gemini 4 Argon

    :::warning ⚠️ Chat only This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results. ::: Streaming Support The Gemini endpoint returns streaming chunks from streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall. Streaming Response Format: - Content-Type: text/event-stream. The last data chunk carries usageMetadata and creditsconsumed, followed by data: [DONE]. - Function calls are returned inside parts[].functionCall - Thinking output may be reflected through thoughtSignature and usage metadata Features - Standard chat with contents. - Google Search grounding with googleSearch. - Function calling with functionDeclarations. - Thinking configuration with generationConfig.thinkingConfig. Request Notes - Use contents as the primary conversation input. - Use tools.googleSearch to enable Google Search grounding. - Use tools.functionDeclarations to define callable functions. - Use generationConfig.thinkingConfig to control thoughts output and thinking level. Authentication Authentication: send your KIE API key as Authorization: Bearer YOURAPIKEY. Error Responses Errors are returned with HTTP 200 and a JSON body {"code": , "msg": " "}. Check code (200 = success) before reading choices/candidates.

    POST /gemini/v1/models/gemini-4-argon:streamGenerateContent

  • Write

    Generate Grok Responses result

    Submit a generation request through this shared POST route. The official reference documents 4 request/model variants with different model identifiers and input schemas; use the linked model reference for required inputs. Documented model identifiers: grok-4-3, grok-4-5, grok-4-6, grok-4-7.

    POST /grok/v1/responses

File uploads

  • Write

    Base64 File Upload

    :::info[] Uploaded files are deleted 24 hours after upload. ::: Features Supports Base64 encoded data and data URL formats The MIME type and extension are taken from the data URL prefix (e.g. data:image/png;base64,...) or from the fileName extension. Supports custom filenames or auto-generation (identical filenames will overwrite old files, potential caching delays may occur) Returns complete file information and download links Protected by API Key authentication Supported Formats Plain Base64 strings: iVBORw0KGgoAAAANSUhEUgAA... Data URL format: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA... Usage Recommendations Recommended for small files such as images Large files (10MB) should use the File Stream Upload API Base64 encoding increases data transmission volume by approximately 33%

    POST /api/file-base64-upload

  • Write

    File Stream Upload

    :::info[] Uploaded files are deleted 24 hours after upload. ::: Features Supports binary stream upload for multiple file types Suitable for large file uploads with high transmission efficiency Automatically identifies MIME types Supports custom filenames or auto-generation (identical filenames will overwrite old files, potential caching delays may occur) Returns complete file information and download links Protected by API Key authentication Usage Recommendations Recommended for large files (10MB) Supports multiple formats: images, videos, documents, etc. Avoids the ~33% size overhead of Base64 encoding. Example Command bash theme={null} curl -X POST https://kieai.redpandaai.co/api/file-stream-upload \ -H "Authorization: Bearer YOURAPIKEY" \ -F "file=@/path/to/your-file.jpg" \ -F "uploadPath=images/user-uploads" \ -F "fileName=custom-name.jpg"

    POST /api/file-stream-upload

  • Write

    URL File Upload

    :::info[] Uploaded files are deleted 24 hours after upload. ::: Features Supports HTTP and HTTPS file links Automatically downloads remote files and uploads them If fileName is omitted, a random file name is generated (the original extension is kept). Identical filenames overwrite old files; caching delays may occur. Automatically identifies MIME types Returns complete file information and download links Protected by API Key authentication Supported Protocols HTTP: http://example.com/file.jpg HTTPS: https://example.com/file.jpg Use Cases Migrating files from other services Batch downloading and storing web resources Backing up remote files Caching external resources Important Notes Ensure the provided URL is publicly accessible Download timeout is 30 seconds Recommended maximum file size is 100MB

    POST /api/file-url-upload

See How connections work for access and permissions, or browse all integrations.