diff --git a/flux/docs/flux_images_generation_api_integration_guide.md b/flux/docs/flux_images_generation_api_integration_guide.md index de0ad12..d829c87 100644 --- a/flux/docs/flux_images_generation_api_integration_guide.md +++ b/flux/docs/flux_images_generation_api_integration_guide.md @@ -1,22 +1,27 @@ -# Flux Images Generation API Integration Instructions +--- +title: "Flux Images Generation API Integration Instructions" +description: "Flux Image Generation integration guide - Ace Data Cloud" +--- This article will introduce the integration instructions for the Flux Images Generation API, which can generate official Flux images by inputting custom parameters. ## Application Process -To use the API, you need to first apply for the corresponding service on the [Flux Images Generation API](https://platform.acedata.cloud/documents/6b9197c5-7a3f-4878-a43f-7f94e7e66394) page. After entering the page, click the "Acquire" button, as shown in the image below: +To use Flux Images Generation API, first open the [Ace Data Cloud Console](https://platform.acedata.cloud/console/applications) and copy your API Token. -![](https://cdn.acedata.cloud/q6ytrc.png) +![](https://cdn.acedata.cloud/5hmkdg.jpg) -If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in. After logging in or registering, you will be automatically returned to the current page. +If you are not logged in, you will be redirected to sign in and brought back to this page automatically. -Upon your first application, there will be a free quota available for you to use the API for free. +**A single API Token works across every service on the platform — no need to subscribe per service.** New accounts receive free starter credit; when it runs low you can top up your shared balance in the [console](https://platform.acedata.cloud/console/coin). + +> 📘 Full documentation: [Flux Images Generation API →](https://platform.acedata.cloud/documents/flux-images) ## Basic Usage First, understand the basic usage method, which involves inputting the prompt `prompt`, the action `action`, and the image size `size` to obtain the processed result. You first need to simply pass a field `action` with the value `generate`, and then we also need to input the prompt, as detailed below: -

+

Here we can see that we have set the Request Headers, including: @@ -39,15 +44,19 @@ The parameter `size` has some special restrictions, mainly divided into two type | flux-2-flex | Supports aspect ratio x >= 64 must be a multiple of 32 | | flux-2-pro | Supports aspect ratio x >= 64 must be a multiple of 32 | | flux-2-max | Supports aspect ratio x >= 64 must be a multiple of 32 | -| flux-dev | Supports aspect ratio 256 <= x <= 1440 must be a multiple of 32 | +| flux-pro-1.1 | Supports aspect ratio 256 <= x <= 1440 must be a multiple of 32 | +| flux-dev | Supports aspect ratio 256 <= x <= 1440 must be a multiple of 32 | +| flux-pro-1.1-ultra | Does not support aspect ratio supports image ratio | | flux-kontext-pro | Does not support aspect ratio supports image ratio | | flux-kontext-max | Does not support aspect ratio supports image ratio | Reference image ratios: "1:1", "16:9", "21:9", "3:2", "2:3", "4:5", "5:4", "3:4", "4:3", "9:16", "9:21", -After selection, the corresponding code is generated on the right side. Before copying it, confirm that the authorization header uses your own API key; real credentials must never appear in documentation or screenshots. +After selection, you can see that the corresponding code is also generated on the right side, as shown in the image below: + +

-Click the "Try" button to test, and we get the following result: +Click the "Try" button to test, as shown in the image above, and we get the following result: ```json { @@ -57,12 +66,12 @@ Click the "Try" button to test, and we get the following result: "data": [ { "prompt": "a white siamese cat", - "image_url": "https://fal.media/files/lion/NVhtlwwGYQD6HrGaEfrzu_341484fad6d84b21b73f4f8824a3f98a.png", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png?example=image-001", "timings": 1752743801 }, { "prompt": "a white siamese cat", - "image_url": "https://fal.media/files/monkey/8UEQpFbQCYVOK1wKP3aV0_9bbc26fad64049b18d0244b99ef66ad1.png", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png?example=image-002", "timings": 1752743801 } ] @@ -104,11 +113,11 @@ If you want to edit a specific image, the parameter `image_url` must first be pa An example of the input is as follows: -

+

After filling in, the code is automatically generated as follows: -

+

The corresponding code: @@ -144,7 +153,7 @@ Clicking run, you can find that you will immediately get a result, as follows: "data": [ { "prompt": "a white siamese cat", - "image_url": "https://fal.media/files/monkey/aEUXJZ6Faj9YXUCQVs01Q_af0cea56c558441c9ba8df67b200812d.png", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png?example=image-001", "timings": 1752744073 } ] @@ -168,7 +177,7 @@ Copy this URL, and it can be used as a Webhook. The sample here is `https://webh Next, we can set the `callback_url` field to the above Webhook URL and fill in the corresponding parameters, as shown in the image: -

+

Clicking run, you will immediately receive a result as follows: @@ -192,7 +201,7 @@ The content is as follows: "data": [ { "prompt": "a white siamese cat", - "image_url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/f4f8d407-377a-408a-82d0-427a5a836f09_0.png", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png?example=image-001", "seed": 1698551532, "timings": { "inference": 3.328 @@ -229,4 +238,4 @@ When calling the API, if an error occurs, the API will return the corresponding ## Conclusion -Through this document, you have learned how to use the Flux Images Generation API to generate images by inputting prompts. We hope this document helps you better integrate and use this API. If you have any questions, please feel free to contact our technical support team. \ No newline at end of file +Through this document, you have learned how to use the Flux Images Generation API to generate images by inputting prompts. We hope this document helps you better integrate and use this API. If you have any questions, please feel free to contact our technical support team. diff --git a/flux/docs/flux_tasks_api_integration_guide.md b/flux/docs/flux_tasks_api_integration_guide.md index 8c91f68..f19a030 100644 --- a/flux/docs/flux_tasks_api_integration_guide.md +++ b/flux/docs/flux_tasks_api_integration_guide.md @@ -1,4 +1,7 @@ -# Integration and Use of Flux Tasks API +--- +title: "Integration and Use of Flux Tasks API" +description: "Flux Image Generation integration guide - Ace Data Cloud" +--- The main function of the Flux Tasks API is to query the execution status of tasks by inputting the task ID generated by the Flux Images Generation API. @@ -6,33 +9,31 @@ This document will provide detailed integration instructions for the Flux Tasks ## Application Process -To use the Flux Tasks API, you first need to apply for the corresponding service on the application page [Flux Images Generation API](https://platform.acedata.cloud/documents/6b9197c5-7a3f-4878-a43f-7f94e7e66394), and then copy the task ID from the Flux Images Generation API, as shown in the image below: +To use the Flux Images Generation API, first obtain your API Token from the [Ace Data Cloud Console](https://platform.acedata.cloud/console/applications) for future reference. -

+![](https://cdn.acedata.cloud/5hmkdg.jpg) -Finally, go to the Flux Tasks API page [Flux Tasks API](https://platform.acedata.cloud/documents/39b38bbe-60f3-40da-b2b6-5ce1e091852b) to apply for the corresponding service. After entering the page, click the "Acquire" button, as shown in the image below. +If you are not logged in or registered, you will be automatically redirected to the login page to invite you to register and log in, and after completion, you will be automatically returned to the current page. -![Application Page](https://cdn.acedata.cloud/rci31i.png) +**One API Token can call all services on the platform without needing to apply separately for each service.** The first application will grant a free quota for a trial experience; when the quota is insufficient, you can recharge the general balance in the [console](https://platform.acedata.cloud/console/coin). -If you are not logged in or registered, you will be automatically redirected to the [login page](https://platform.acedata.cloud) inviting you to register and log in. After logging in or registering, you will be automatically returned to the current page. - -There is a free quota available for first-time applicants, allowing you to use this API for free. +> 📘 Complete Documentation: [Flux Images Generation API →](https://platform.acedata.cloud/documents/flux-images) ## Request Example The Flux Tasks API can be used to query the results of the Flux Images Generation API. For information on how to use the Flux Images Generation API, please refer to the documentation [Flux Images Generation API](https://platform.acedata.cloud/documents/flux-images-integration). -We will use a task ID returned by the Flux Images Generation API service as an example to demonstrate how to use this API. Suppose we have a task ID: 2db0168c-2373-4367-8d9a-9dc778802e8a, and we will demonstrate how to pass in a task ID. +We will demonstrate how to use this API with an example task ID returned by the Flux Images Generation API. Suppose we have a task ID: 2db0168c-2373-4367-8d9a-9dc778802e8a, we will demonstrate how to pass in a task ID. ### Task Example Image -

+

### Setting Request Headers and Request Body **Request Headers** include: -- `accept`: Specifies that the response should be in JSON format, set to `application/json`. +- `accept`: Specifies that the response result should be in JSON format, set to `application/json`. - `authorization`: The key to call the API, which can be selected directly after application. **Request Body** includes: @@ -42,13 +43,13 @@ We will use a task ID returned by the Flux Images Generation API service as an e Set as shown in the image below: -

+

### Code Example -You can see that various language codes have been automatically generated on the right side of the page, as shown in the image below: +You can see that various language codes have been automatically generated on the right side of the page, as shown in the image: -

+

Some code examples are as follows: @@ -89,7 +90,7 @@ print(response.text) ### Response Example -Upon a successful request, the API will return the detailed information of the image task here. For example: +Upon successful request, the API will return the detailed information of the image task here. For example: ```json { @@ -98,6 +99,9 @@ Upon a successful request, the API will return the detailed information of the i "api_id": "deefc5d7-7f22-43e9-929e-f2b6afee60b7", "application_id": "001c2f84-2a4a-4c4d-ba3f-8a89f43b5be2", "created_at": 1736304669.779, + "started_at": 1736304669.839, + "finished_at": 1736304679.439, + "elapsed": 9.6, "credential_id": "b00bddd3-140f-4343-a9a2-affb312b60de", "request": { "action": "generate", @@ -113,7 +117,7 @@ Upon a successful request, the API will return the detailed information of the i "data": [ { "prompt": "a white siamese cat", - "image_url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/57d9ff7c-5a00-409e-9dcc-90f35b38d16e_0.png", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png?example=image-001", "seed": 281520112, "timings": { "inference": 3.193 @@ -124,11 +128,15 @@ Upon a successful request, the API will return the detailed information of the i } ``` -The returned result contains multiple fields, with the request field being the request body when the task was initiated, and the response field being the response body returned after the task is completed. The field descriptions are as follows. +The returned result contains multiple fields, the request field is the request body when the task was initiated, while the response field is the response body returned after the task is completed. The field descriptions are as follows. - `id`: The ID of the image task generated, used to uniquely identify this image generation task. - `request`: The request information in the image task. - `response`: The return information in the image task. +- `created_at`: The task creation time, Unix timestamp (seconds, float). +- `started_at`: The task start execution time, Unix timestamp (seconds, float). +- `finished_at`: The task completion time, Unix timestamp (seconds, float). This field is not returned if the task is not completed. +- `elapsed`: The time taken for task execution, in seconds (float, rounded to 3 decimal places). This field is not returned if the task is not completed. ## Batch Query Operation @@ -136,24 +144,24 @@ This is for querying the details of multiple task IDs, and unlike the above, the **Request Body** includes: -- `ids`: An array of uploaded task IDs. +- `ids`: The array of uploaded task IDs. - `action`: The operation method for the task. Set as shown in the image below: -

+

### Code Example -You can see that various language codes have been automatically generated on the right side of the page, as shown in the image below: +You can see that various language codes have been automatically generated on the right side of the page, as shown in the image: -

+

Some code examples are as follows: ### Response Example -Upon a successful request, the API will return the specific details of all batch image tasks this time. For example: +Upon successful request, the API will return the specific details of all batch image tasks this time. For example: ```json { "items": [ @@ -163,6 +171,9 @@ Upon a successful request, the API will return the specific details of all batch "api_id": "deefc5d7-7f22-43e9-929e-f2b6afee60b7", "application_id": "001c2f84-2a4a-4c4d-ba3f-8a89f43b5be2", "created_at": 1736304669.779, + "started_at": 1736304669.839, + "finished_at": 1736304679.439, + "elapsed": 9.6, "credential_id": "b00bddd3-140f-4343-a9a2-affb312b60de", "request": { "action": "generate", @@ -178,7 +189,7 @@ Upon a successful request, the API will return the specific details of all batch "data": [ { "prompt": "a white siamese cat", - "image_url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/57d9ff7c-5a00-409e-9dcc-90f35b38d16e_0.png", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png?example=image-001", "seed": 281520112, "timings": { "inference": 3.193 @@ -193,6 +204,9 @@ Upon a successful request, the API will return the specific details of all batch "api_id": "deefc5d7-7f22-43e9-929e-f2b6afee60b7", "application_id": "001c2f84-2a4a-4c4d-ba3f-8a89f43b5be2", "created_at": 1736304976.278, + "started_at": 1736304976.338, + "finished_at": 1736304985.938, + "elapsed": 9.6, "credential_id": "b00bddd3-140f-4343-a9a2-affb312b60de", "request": { "action": "generate", @@ -208,7 +222,7 @@ Upon a successful request, the API will return the specific details of all batch "data": [ { "prompt": "a white siamese cat", - "image_url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/57b5c7e5-3436-466d-86ed-583ede4a3d7c_0.png", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png?example=image-002", "seed": 1437672535, "timings": { "inference": 3.175 @@ -222,11 +236,6 @@ Upon a successful request, the API will return the specific details of all batch } ``` -The returned result contains multiple fields, among which `items` includes the specific details of batch image tasks, and each image task's specific information is the same as the format of the single task return result mentioned above. The field information is as follows. - -- `items`, all specific detail information of batch image tasks. It is an array, and each element of the array has the same format as the return result of querying a single task above. -- `count`, the number of image tasks in this batch query. - #### CURL ```bash @@ -287,4 +296,4 @@ When calling the API, if an error occurs, the API will return the corresponding ## Conclusion -Through this document, you have learned how to use the FLux Tasks API to query all specific detail information of single or batch image tasks. We hope this document can help you better integrate and use this API. If you have any questions, please feel free to contact our technical support team. \ No newline at end of file +Through this document, you have learned how to use the FLux Tasks API to query the specific details of single or batch image tasks. We hope this document helps you better integrate and use the API. If you have any questions, please feel free to contact our technical support team. diff --git a/flux/openapi/flux.json b/flux/openapi/flux.json new file mode 100644 index 0000000..983892b --- /dev/null +++ b/flux/openapi/flux.json @@ -0,0 +1,1015 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Flux Image Generation", + "version": "1.0.0", + "description": "API reference for Flux Image Generation on Ace Data Cloud." + }, + "servers": [ + { + "url": "https://api.acedata.cloud", + "description": "Ace Data Cloud API" + } + ], + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "description": "API token from https://platform.acedata.cloud" + } + }, + "schemas": { + "FluxTaskRequestPayload": { + "type": "object", + "additionalProperties": true, + "description": "Request body recorded from the API operation that created this task. Fields depend on that operation and action." + }, + "FluxTaskResultPayload": { + "type": "object", + "additionalProperties": true, + "description": "Final response recorded from the API operation that created this task. Fields follow that operation’s documented success or error contract." + }, + "FluxTaskRecord": { + "type": "object", + "required": [ + "id", + "type", + "created_at", + "trace_id", + "request" + ], + "properties": { + "id": { + "type": "string", + "description": "Task identifier." + }, + "type": { + "type": "string", + "description": "Task type." + }, + "trace_id": { + "type": "string", + "description": "Request trace identifier." + }, + "request": { + "$ref": "#/components/schemas/FluxTaskRequestPayload" + }, + "response": { + "$ref": "#/components/schemas/FluxTaskResultPayload" + }, + "created_at": { + "type": "number", + "format": "double", + "description": "Unix timestamp in seconds when the task was created." + }, + "started_at": { + "type": "number", + "format": "double", + "description": "Unix timestamp in seconds when processing started." + }, + "finished_at": { + "type": "number", + "format": "double", + "nullable": true, + "description": "Unix timestamp in seconds when processing finished." + }, + "elapsed": { + "type": "number", + "format": "double", + "minimum": 0, + "nullable": true, + "description": "Processing duration in seconds." + }, + "user_id": { + "type": "string", + "description": "Account that owns the task." + }, + "actor_user_id": { + "type": "string", + "nullable": true, + "description": "Account that executed an authorized request." + }, + "api_id": { + "type": "string", + "description": "API identifier." + }, + "application_id": { + "type": "string", + "description": "Application used for billing." + }, + "credential_id": { + "type": "string", + "nullable": true, + "description": "Credential used to start the task." + }, + "authorization_id": { + "type": "string", + "nullable": true, + "description": "Authorization used to start the task." + } + } + } + } + }, + "security": [ + { + "bearerAuth": [] + } + ], + "paths": { + "/flux/images": { + "post": { + "summary": "Flux Images", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "example": { + "data": [ + { + "seed": "pop upbeat", + "prompt": "a christmas song", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png" + } + ], + "success": true + }, + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "seed": { + "type": "string" + }, + "prompt": { + "type": "string" + }, + "image_url": { + "type": "string", + "format": "uri" + } + } + }, + "description": "Generated result entries." + }, + "success": { + "type": "boolean", + "description": "Flux Images Response 200 Success" + } + } + }, + "example": { + "data": [ + { + "seed": "pop upbeat", + "prompt": "a christmas song", + "image_url": "https://cdn.acedata.cloud/e724d7f13d.png" + } + ], + "success": true + } + } + }, + "description": "Flux Images Response 200" + }, + "400": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "token_mismatched", + "message": "The specified token is not matched with API." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "token_mismatched", + "description": "Flux Images Response 400 Error Code" + }, + "message": { + "type": "string", + "example": "The specified token is not matched with API.", + "description": "Flux Images Response 400 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 400 Trace Id" + } + } + }, + { + "type": "object", + "example": { + "error": { + "code": "api_not_implemented", + "message": "The API is not implemented." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "api_not_implemented", + "description": "Flux Images Response 400 Error Code 2" + }, + "message": { + "type": "string", + "example": "The API is not implemented.", + "description": "Flux Images Response 400 Error Message 2" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 400 Trace Id 2" + } + } + }, + { + "type": "object", + "example": { + "error": { + "code": "disabled", + "message": "Your application has been disabled by Ace Data Cloud due to abnormal usage behavior, please contact our support to get more information." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "disabled", + "description": "Flux Images Response 400 Error Code 3" + }, + "message": { + "type": "string", + "example": "Your application has been disabled by Ace Data Cloud due to abnormal usage behavior, please contact our support to get more information.", + "description": "Flux Images Response 400 Error Message 3" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 400 Trace Id 3" + } + } + }, + { + "type": "object", + "example": { + "error": { + "code": "bad_request", + "message": "model is invalid." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "bad_request", + "description": "Flux Images Response 400 Error Code 4" + }, + "message": { + "type": "string", + "example": "model is invalid.", + "description": "Flux Images Response 400 Error Message 4" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 400 Trace Id 4" + } + } + }, + { + "type": "object", + "example": { + "error": { + "code": "no_token", + "message": "No token specified for the request." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "no_token", + "description": "Flux Images Response 400 Error Code 5" + }, + "message": { + "type": "string", + "example": "No token specified for the request.", + "description": "Flux Images Response 400 Error Message 5" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 400 Trace Id 5" + } + } + } + ] + } + } + }, + "description": "Flux Images Response 400" + }, + "401": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "invalid_token", + "message": "The specified token is invalid or wrong." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "invalid_token", + "description": "Flux Images Response 401 Error Code" + }, + "message": { + "type": "string", + "example": "The specified token is invalid or wrong.", + "description": "Flux Images Response 401 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 401 Trace Id" + } + } + }, + { + "type": "object", + "example": { + "error": { + "code": "token_expired", + "message": "token expired." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "token_expired", + "description": "Flux Images Response 401 Error Code 2" + }, + "message": { + "type": "string", + "example": "token expired.", + "description": "Flux Images Response 401 Error Message 2" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 401 Trace Id 2" + } + } + }, + { + "type": "object", + "example": { + "error": { + "code": "token_mismatched", + "message": "token and api does not match." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "token_mismatched", + "description": "Flux Images Response 401 Error Code 3" + }, + "message": { + "type": "string", + "example": "token and api does not match.", + "description": "Flux Images Response 401 Error Message 3" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 401 Trace Id 3" + } + } + } + ] + } + } + }, + "description": "Flux Images Response 401" + }, + "403": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "used_up", + "message": "Your balance is not sufficient for current request, please buy more in Ace Data Cloud." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "used_up", + "description": "Flux Images Response 403 Error Code" + }, + "message": { + "type": "string", + "example": "Your balance is not sufficient for current request, please buy more in Ace Data Cloud.", + "description": "Flux Images Response 403 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 403 Trace Id" + } + } + } + ] + } + } + }, + "description": "Flux Images Response 403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "no_api", + "message": "API does not exist, please make sure url is correct." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "no_api", + "description": "Flux Images Response 404 Error Code" + }, + "message": { + "type": "string", + "example": "API does not exist, please make sure url is correct.", + "description": "Flux Images Response 404 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 404 Trace Id" + } + } + } + ] + } + } + }, + "description": "Flux Images Response 404" + }, + "429": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "too_many_requests", + "message": "You have exceeded the rate limit." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "too_many_requests", + "description": "Flux Images Response 429 Error Code" + }, + "message": { + "type": "string", + "example": "You have exceeded the rate limit.", + "description": "Flux Images Response 429 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 429 Trace Id" + } + } + } + ] + } + } + }, + "description": "Flux Images Response 429" + }, + "500": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "api_error", + "message": "Internal server error." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "api_error", + "description": "Flux Images Response 500 Error Code" + }, + "message": { + "type": "string", + "example": "Internal server error.", + "description": "Flux Images Response 500 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Images Response 500 Trace Id" + } + } + } + ] + } + } + }, + "description": "Flux Images Response 500" + } + }, + "parameters": [ + { + "in": "header", + "name": "accept", + "schema": { + "enum": [ + "application/json", + "application/x-ndjson" + ], + "type": "string" + }, + "required": false, + "description": "Flux Images Param Accept" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "action", + "prompt" + ], + "properties": { + "size": { + "type": "string", + "example": "1024x1024", + "description": "Flux Images Size" + }, + "count": { + "type": "number", + "description": "Flux Images Count" + }, + "model": { + "enum": [ + "flux-dev", + "flux-pro", + "flux-kontext-pro", + "flux-kontext-max", + "flux-2-flex", + "flux-2-pro", + "flux-2-max", + "flux-2-klein" + ], + "type": "string", + "example": "generate", + "description": "Flux Images Model" + }, + "action": { + "enum": [ + "generate", + "edit" + ], + "type": "string", + "example": "generate", + "description": "Flux Images Action" + }, + "prompt": { + "type": "string", + "example": "a white siamese cat", + "description": "Flux Images Prompt" + }, + "image_url": { + "type": "string", + "description": "Flux Images Image Url" + }, + "callback_url": { + "type": "string", + "description": "Flux Images Callback Url" + }, + "async": { + "type": "boolean", + "description": "Flux Images Async" + } + } + } + } + }, + "required": true + }, + "operationId": "createFluxImages" + } + }, + "/flux/tasks": { + "post": { + "summary": "Flux Tasks", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/FluxTaskRecord" + }, + { + "type": "object", + "required": [ + "items", + "count" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FluxTaskRecord" + }, + "description": "Matching tasks." + }, + "count": { + "type": "integer", + "minimum": 0, + "description": "Total matching task count." + } + } + }, + { + "type": "object", + "additionalProperties": false, + "description": "Returned when the requested task does not exist." + } + ] + }, + "example": { + "items": [], + "count": 0 + } + } + }, + "description": "Flux Tasks Response 200" + }, + "400": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "token_mismatched", + "message": "The specified token is not matched with API." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "token_mismatched", + "description": "Flux Tasks Response 400 Error Code" + }, + "message": { + "type": "string", + "example": "The specified token is not matched with API.", + "description": "Flux Tasks Response 400 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Tasks Response 400 Trace Id" + } + } + }, + { + "type": "object", + "example": { + "error": { + "code": "api_not_implemented", + "message": "The API is not implemented." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "api_not_implemented", + "description": "Flux Tasks Response 400 Error Code 2" + }, + "message": { + "type": "string", + "example": "The API is not implemented.", + "description": "Flux Tasks Response 400 Error Message 2" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Tasks Response 400 Trace Id 2" + } + } + } + ] + } + } + }, + "description": "Flux Tasks Response 400" + }, + "401": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "invalid_token", + "message": "The specified token is invalid or wrong." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "invalid_token", + "description": "Flux Tasks Response 401 Error Code" + }, + "message": { + "type": "string", + "example": "The specified token is invalid or wrong.", + "description": "Flux Tasks Response 401 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Tasks Response 401 Trace Id" + } + } + } + ] + } + } + }, + "description": "Flux Tasks Response 401" + }, + "429": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "too_many_requests", + "message": "You have exceeded the rate limit." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "too_many_requests", + "description": "Flux Tasks Response 429 Error Code" + }, + "message": { + "type": "string", + "example": "You have exceeded the rate limit.", + "description": "Flux Tasks Response 429 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Tasks Response 429 Trace Id" + } + } + } + ] + } + } + }, + "description": "Flux Tasks Response 429" + }, + "500": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "example": { + "error": { + "code": "api_error", + "message": "Internal server error." + }, + "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab" + }, + "properties": { + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "api_error", + "description": "Flux Tasks Response 500 Error Code" + }, + "message": { + "type": "string", + "example": "Internal server error.", + "description": "Flux Tasks Response 500 Error Message" + } + } + }, + "trace_id": { + "type": "string", + "description": "Flux Tasks Response 500 Trace Id" + } + } + } + ] + } + } + }, + "description": "Flux Tasks Response 500" + } + }, + "parameters": [ + { + "in": "header", + "name": "accept", + "schema": { + "enum": [ + "application/json" + ], + "type": "string" + }, + "required": false, + "description": "Flux Tasks Param Accept" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Flux Tasks Id" + }, + "ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Flux Tasks Ids" + }, + "action": { + "enum": [ + "retrieve", + "retrieve_batch" + ], + "type": "string", + "default": "retrieve", + "description": "Flux Tasks Action" + } + }, + "example": { + "action": "retrieve", + "id": "task-id" + } + } + } + }, + "required": true + }, + "operationId": "queryFluxTasks" + } + } + } +}