recraft/4.0/style/text-to-image
4.0 Style is Recraft's advanced text-to-image AI model. Create photorealistic images, illustrations, and concept art from natural language descriptions with exceptional detail and prompt adherence.
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Example output — click Run to generate your own
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
https://api.sandbase.ai/v1/runrecraft/4.0/style/text-to-imageInput Schema
7 parameters · 1 required · 6 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | Min length: 1 · Max length: 10000 |
colors | object[] | Optional | An array of preferable colors · Default: [] |
images | string[] | Optional | The URLs of the style reference images. Supports PNG, JPG, and WEBP; provide between 1 and 10 images. |
style_id | string | Optional | The ID of an existing V4 custom style. |
style_match | string | Optional | Override how closely the generation follows the custom style. · Options: precise, flexible preciseflexible |
aspect_ratio | string | Optional | The aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16 21:916:93:24:35:41:14:53:42:39:16 |
background_color | string | Optional | The preferable background color of the generated images. |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "recraft/4.0/style/text-to-image",
"colors": [],
"prompt": "Tilt-shift miniature effect on a real Portuguese fishing village at golden hour, colorful boats in the harbor appearing toy-like, selective focus band across the middle, saturated primary colors of blue red and yellow boats against white buildings, 90mm tilt-shift lens, the familiar made fantastical, Wes Anderson color sensibility"
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"API README
Text To Image
Text To Image occupies the generated-image role in the model catalog for design-system owners. Its practical value is to separate this job from adjacent family routes: an upstream service can confirm that it has prompt, submit one well-scoped job, and receive a generated image asset for downstream approval. This positioning explains when the exact recraft/4.0/style/text-to-image route belongs in an architecture without borrowing promises from another version, tier, or task variant.
A production-minded integration begins by checking the campaign objective, review rubric, and export requirement. The caller records required values separately from optional choices such as images, background_color, colors, style_id, style_match, aspect_ratio, runs a small representative sample, and stores the route name with the resulting artifact. Reviewers then compare that artifact with the agreed acceptance criteria, document any rejected setup, and promote only a successful request shape into larger batches. This workflow gives recraft/4.0/style/text-to-image measurable business context while leaving the Highlights section to explain model behavior.
Highlights
- Prompt-responsive composition. Recraft V4 Styles Text to Image turns detailed natural-language art direction into a complete visual with a defined subject, setting, and treatment.
- Style range. The route can interpret photographic, illustrative, graphic, or conceptual direction when those choices are stated clearly in the prompt.
- Layout control. Supported framing and composition controls help Recraft V4 Styles Text to Image prepare imagery for landscape, square, portrait, or design-specific placements.
- Iteration-ready output. Seed and other declared creative controls make it practical to compare focused variations while retaining the core brief.
Pricing
| Billing option | Price |
|---|---|
| Billing formula | params.style_id ? 0.041 : 0.047 |
With style_id | $0.041000 |
Without style_id | $0.047000 |
When to Use
| Scenario | Why it fits |
|---|---|
| Choose Text To Image | Use it when the job specifically calls for text to image and the route’s documented input contract matches assets already available in your workflow. |
| Keep the request reproducible | Use the required prompt explicitly, then record optional choices alongside the prompt for repeatable reruns. |
| Build controlled creative variations | Change one declared control at a time when comparing framing, format, duration, resolution, style, or other route-supported output decisions. |
| Integrate asynchronous delivery | Use this endpoint when an application can submit work, track completion, and collect the returned media URL instead of requiring an immediate inline artifact. |
| Validate before a large batch | Run representative prompts and source assets first, confirm the visual or audio behavior, then lock the successful request shape for scaled production. |
Prompt Guide
Lead with the subject or transformation, then add the composition, environment, style, lighting, motion, voice, or fidelity details relevant to this route. Keep every parameter inside the documented schema; the example below uses only fields declared for recraft/4.0/style/text-to-image.
{
"prompt": "Tilt-shift miniature effect on a real Portuguese fishing village at golden hour, colorful boats in the harbor appearing toy-like, selective focus band across the middle, saturated primary colors of blue red and yellow boats against white buildings, 90mm tilt-shift lens, the familiar made fantastical, Wes Anderson color sensibility",
"style_match": "precise",
"aspect_ratio": "21:9"
}
Technical Specs
| Specification | Details |
|---|---|
| Model ID | recraft/4.0/style/text-to-image |
| Execution mode | async |
| Task type | image |
prompt | string · required |
images | array · optional |
background_color | string · optional |
colors | array · optional |
style_id | string · optional |
style_match | string · optional · choices: precise, flexible |
aspect_ratio | string · optional · choices: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16 |

