> For the complete documentation index, see [llms.txt](https://docs.airight.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airight.io/services-and-integration/ai-service/flux.md).

# Flux

* **Image Generation API:**

  This API allows you to generate images from textual descriptions using the Flux model.
* **Try it out**

  Get your API key at the following site: <https://airight.io/api-key>
* **How to use**
  * Please call the following endpoint with a `POST` request: <https://developers.airight.io/nft-market-backend-service/sdk/models/flux>
  * The headers of the request must include an API key in the `x-api-key` field. The body of the request must be `multipart/form-data`, and the `accept` header should be set `application/json`
* **Parameters:**
  * *<mark style="color:blue;">callback</mark>*: (required) an api url that we can call by POST method to return the result after the image is generated.
  * *<mark style="color:blue;">modelId</mark>*: (required) The Model ID is what we use to set default values for optional parameters. Its value is `133`
  * *<mark style="color:blue;">prompt</mark>*: (required) A textual description of the desired image. More specific and detailed prompts yield better results.
  * *<mark style="color:blue;">width</mark>, <mark style="color:blue;">height</mark>*: (optional) The dimensions of the generated image. Default is `512`.
* **Response:**

  The API returns the job ID which you can get the result by calling the api [https://developers.airight.io/nft-market-backend-service/sdk/art/{id}](https://developers.airight.io/nft-market-backend-service/sdk/art/%7Bid%7D) if we are unable to call the callback url to send you the response.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.airight.io/services-and-integration/ai-service/flux.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
