API
This document describes the input and output parameters for calling AI models via API.
How to get your API ready
Step 1: Open the API Playground and copy the API call command.
Step 2: Click API Key to find it.
Image Generation API Documentation
Parameter Name | Description | Example Value |
---|---|---|
URL | The API endpoint for invoking the image generation model. | https://api.runc.ai/v1/images/generations |
Model ID | Specifies which model to use for your API call. | - black-forest-labs/flux-kontext-pro/text-to-image - black-forest-labs/flux-kontext-max/text-to-image - black-forest-labs/flux-kontext-pro - black-forest-labs/flux-kontext-max - black-forest-labs/flux.1-dev - stepfun-ai/step1x-edit |
API Key | Your authentication key, required to access the API. | Click here (opens in a new tab) |
Request Parameters
Field Name | Type | Required | Default Value | Supported Models | Description |
---|---|---|---|---|---|
prompt | string | Required | - | All | Prompt used to generate the image. |
model | string | Required | - | All | Name of the model to use for this request. |
n | int | Optional | 1 | black-forest-labs/flux.1-dev, black-forest-labs/flux-kontext-pro/text-to-image black-forest-labs/flux-kontext-max/text-to-image | Number of images to generate. Value range: [1, 4]. |
image | string | Optional | - | black-forest-labs/flux.1-dev (optional), black-forest-labs/flux-kontext-max (required), black-forest-labs/flux-kontext-pro (required), stepfun-ai/step1x-edit (required) | Supports image URL or Base64 encoding (format: data:image/;base64,). |
images | array(string) | Required | - | black-forest-labs/flux-kontext-max, black-forest-labs/flux-kontext-pro | Array of reference images. Each item should be a public URL or Base64-encoded image content. |
response_format | string | Optional | url | black-forest-labs/flux.1-dev | Specifies the return format for generated images. url: returns image link; b64_json: returns Base64-encoded string. |
size | string | Optional | 1024x1024 | black-forest-labs/flux.1-dev | Width and height of the generated image, range: [256x256, 1536x1536]. |
strength | float | Optional | 0.8 | black-forest-labs/flux.1-dev | Degree to which the reference image is applied, range: [0.0, 1.0]. |
aspect_ratio | string | Optional | 1:01 | black-forest-labs/flux-kontext-max/text-to-image, black-forest-labs/flux-kontext-pro/text-to-image | Aspect ratio of the generated image. Supported values: "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21". |
steps | int | Optional | 28 | black-forest-labs/flux.1-dev, stepfun-ai/step1x-edit | Number of inference steps. Higher values produce more detailed results but take longer. |
seed | int | Optional | -1 | All | Random seed to control generation reproducibility. Range: [-1, 9999999999]. If not provided, automatically generated. Same seed reproduces same content. |
guidance_scale | float | Optional | 2.5 | All | Adjusts the adherence to text guidance versus creativity. Higher values: more faithful to prompt but less variety; lower values: more creative. Range: [1, 10]. |
negative_prompt | string | Optional | - | stepfun-ai/step1x-edit | Negative prompt to specify elements you don’t want in the generated image. |
Response Parameters
Field Name | Type | Description |
---|---|---|
created | integer | Unix timestamp (in seconds) of when this request was created. |
data | array | Information about the generated images, including the image download URL or Base64. • If the return format is set to url, the subfield will be url. • If the return format is set to b64_json, the subfield will be b64_json. Note: Links will expire within 7 days after generation, so please save the images promptly. |
error | Object | Error information object. |
error.code | string | Error code. |
error.message | string | Error message. |
error.param | string | Request ID. |
Large Language Model API Documentation
Parameter Name | Description | Example Value |
---|---|---|
URL | The API request address, used to specify the endpoint being called. | https://api.runc.ai/v1/chat/completions |
Model ID | Specifies the model name to be used, determining the specific functionality of the API call. | Qwen/Qwen3-Coder, gemini-2.5-pro, claude-4-sonnet, deepseek-ai/DeepSeek-R1-Distill-Llama-70B |
API Key | A secret key used to verify user identity and ensure only authorized users can access the API service. | Click here (opens in a new tab) |