> ## Documentation Index
> Fetch the complete documentation index at: https://docs.higgsfield.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Recraft V4.1 Pro Text to Image API

> Generate 2K raster images with Recraft V4.1 Pro.

<div className="models-color-scope" aria-hidden="true" />

**Endpoint:** `POST https://api.higgsfield.ai/recraft/v4.1/pro/text-to-image`

**Endpoint ID:** `recraft/v4.1/pro/text-to-image`

<a className="model-playground-card" href="https://console.higgsfield.ai/models/recraft%2Fv4.1%2Fpro%2Ftext-to-image/playground" target="_blank" rel="noreferrer">
  <span className="model-playground-icon">▶</span>
  <span className="model-playground-copy"><span className="model-playground-title">Try Recraft V4.1 Pro</span><span>Open this endpoint in the Higgsfield API Playground.</span></span>
  <span className="model-card-arrow">↗</span>
</a>

## Quick Start

<CodeGroup>
  ```python Python theme={"dark"}
  import higgsfield_client

  result = higgsfield_client.subscribe(
      "recraft/v4.1/pro/text-to-image",
      arguments={
          "prompt": "A premium skincare campaign on a warm limestone pedestal",
          "resolution": "2k",
          "aspect_ratio": "4:5",
          "output_format": "png",
          "colors": [{"rgb": [194, 120, 86]}, {"rgb": [240, 230, 214]}],
          "background_color": {"rgb": [24, 24, 20]},
      },
  )

  print(result["images"][0]["url"])
  ```

  ```typescript TypeScript theme={"dark"}
  import { config, higgsfield } from "@higgsfield/client/v2";

  config({ credentials: process.env.HF_CREDENTIALS });

  const result = await higgsfield.subscribe(
    "recraft/v4.1/pro/text-to-image",
    {
      input: {
        prompt: "A premium skincare campaign on a warm limestone pedestal",
        resolution: "2k",
        aspect_ratio: "4:5",
        output_format: "png",
        colors: [{ rgb: [194, 120, 86] }, { rgb: [240, 230, 214] }],
        background_color: { rgb: [24, 24, 20] },
      },
      withPolling: true,
    },
  );

  if (result.isCompleted) console.log(result.jobs[0].results?.raw.url);
  ```

  ```bash cURL theme={"dark"}
  curl --request POST \
    --url https://api.higgsfield.ai/recraft/v4.1/pro/text-to-image \
    --header "Authorization: Key ${HF_API_KEY_ID}:${HF_API_KEY_SECRET}" \
    --header "Content-Type: application/json" \
    --data '{
      "prompt": "A premium skincare campaign on a warm limestone pedestal",
      "resolution": "2k",
      "aspect_ratio": "4:5",
      "output_format": "png",
      "colors": [{"rgb": [194, 120, 86]}, {"rgb": [240, 230, 214]}],
      "background_color": {"rgb": [24, 24, 20]}
    }'
  ```
</CodeGroup>

## Input Schema

<ParamField body="prompt" type="string" required>
  Text description of the image to generate, from `1` to `10,000` characters.
</ParamField>

<ParamField body="resolution" type="string" default="2k">
  Output resolution. Recraft V4.1 Pro uses `2k`.
</ParamField>

<ParamField body="aspect_ratio" type="string" default="1:1">
  Supported values: `1:1`, `2:1`, `1:2`, `3:2`, `2:3`, `4:3`, `3:4`, `5:4`, `4:5`, `6:10`, `14:10`, `10:14`, `16:9`, `9:16`.
</ParamField>

<ParamField body="output_format" type="string" default="jpg">
  Output file format. Supported values: `png`, `jpg`, `webp`.
</ParamField>

<ParamField body="colors" type="array">
  Optional palette. Each item contains `rgb`, an array of three integers from `0` to `255`.
</ParamField>

<ParamField body="background_color" type="object">
  Optional background color as `{ "rgb": [red, green, blue] }`. The `rgb` array must contain exactly three integers from `0` to `255`.
</ParamField>

## Output Schema

<ResponseField name="status" type="string" required>
  Request state. A newly accepted request returns `queued`.
</ResponseField>

<ResponseField name="request_id" type="string" required>
  Stable identifier used for polling, cancellation, and support.
</ResponseField>

<ResponseField name="status_url" type="string" required>
  URL to poll until the request reaches a terminal state.
</ResponseField>

<ResponseField name="cancel_url" type="string" required>
  URL used to cancel a request before processing starts.
</ResponseField>

<ResponseField name="images" type="array">
  Completed image outputs. Each item contains a download `url`.
</ResponseField>

## Input Example

```json theme={"dark"}
{
  "prompt": "A premium skincare campaign on a warm limestone pedestal",
  "resolution": "2k",
  "aspect_ratio": "4:5",
  "output_format": "png",
  "colors": [
    { "rgb": [194, 120, 86] },
    { "rgb": [240, 230, 214] }
  ],
  "background_color": { "rgb": [24, 24, 20] }
}
```

## Output Example

<CodeGroup>
  ```json Accepted theme={"dark"}
  {
    "status": "queued",
    "request_id": "d7e6c0f3-6699-4f6c-bb45-2ad7fd9158ff",
    "status_url": "https://api.higgsfield.ai/requests/d7e6c0f3-6699-4f6c-bb45-2ad7fd9158ff/status",
    "cancel_url": "https://api.higgsfield.ai/requests/d7e6c0f3-6699-4f6c-bb45-2ad7fd9158ff/cancel"
  }
  ```

  ```json Completed theme={"dark"}
  {
    "status": "completed",
    "request_id": "d7e6c0f3-6699-4f6c-bb45-2ad7fd9158ff",
    "images": [
      { "url": "https://cdn.example.com/recraft-v4-1-pro.png" }
    ]
  }
  ```
</CodeGroup>

<Tip>
  Use an SDK for automatic polling, or poll the returned [status URL](/docs/concepts/polling).
</Tip>


## Related topics

- [Recraft V4.1 Pro API](/docs/models/recraft-v4-1-pro.md)
- [Image Generation API](/docs/models/image-generation.md)
- [Kling 3.0 Pro Text to Video API](/docs/models/kling-3/pro-text-to-video.md)
- [Kling 3.0 Pro Image to Video API](/docs/models/kling-3/pro-image-to-video.md)
- [Model API Reference](/docs/models.md)
