Hoppa till innehåll

Recraft 20b

Integrera

Modell-id recraft-20b
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/recraft-20b?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Den här begäran: 0,022 $ 22 API-krediter · ≈ 2,32 ₽ Kör den på den här sidan

Hämta API-nyckel
Recraft Text till bild #image-generation#vector-art#typograph#style

Text-till-bild-modell med många valbara stilar, inklusive vektor- och digital illustration, samt färganvisningar

Recraft · Bild

Ditt första resultat visas här

Skapa en begäran nedan och kör den med din API-nyckel. Utdata kopieras till vår lagring och sparas för alltid eller 7 dagar kostnadsfritt.

Skapa en begäran

Kontrollerna genereras från modellschemat. Koden och priset uppdateras när du ändrar dem.

•obligatoriskt 88 / 1000
image_size standard square_hd
standard realistic_image

Visuell stil som tillämpas på genererade bilder.

Avancerat style_id · enable_safety_checker · colors

Valfri identifierare för en anpassad stilreferens.

standard []

Array med önskade färger.

POST /run/recraft-20b?wait=20 pris → 0,022 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/recraft-20b?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Kör den här begäran

Din nyckel stannar i den här webbläsaren: den skickas endast till Doitong API och sparas endast i localStorage om du markerar Kom ihåg. Hämta en API-nyckel

Om Recraft 20b

Genererar bilder från en prompt på upp till 1000 tecken. Parametern `style` erbjuder en lång lista med alternativ för realistisk bild, digital illustration och vektorillustration, och `style_id` hänvisar till en anpassad stil. En `colors`-array föreslår önskade färger, och `image_size` erbjuder förinställningar för kvadrat, stående och liggande format.

Parametrar

NamnTyp StandardTillåtna Beskrivning
promptobligatoriskt
Typstring
≤ 1 000 tecken
image_sizevalfritt
Typobject
Standardsquare_hd
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
stylevalfritt
Typenum
Standardrealistic_image
anyrealistic_imagedigital_illustrationvector_illustrationrealistic_image/b_and_wrealistic_image/enterpriserealistic_image/hard_flashrealistic_image/hdrrealistic_image/motion_blurrealistic_image/natural_lightrealistic_image/studio_portraitdigital_illustration/2d_art_posterdigital_illustration/2d_art_poster_2digital_illustration/3ddigital_illustration/80sdigital_illustration/engraving_color
+21 tilldigital_illustration/glowdigital_illustration/graindigital_illustration/hand_drawndigital_illustration/hand_drawn_outlinedigital_illustration/handmade_3ddigital_illustration/infantile_sketchdigital_illustration/kawaiidigital_illustration/pixel_artdigital_illustration/psychedelicdigital_illustration/seamlessdigital_illustration/voxeldigital_illustration/watercolorvector_illustration/cartoonvector_illustration/doodle_line_artvector_illustration/engravingvector_illustration/flat_2vector_illustration/kawaiivector_illustration/line_artvector_illustration/line_circuitvector_illustration/linocutvector_illustration/seamless
Visuell stil som tillämpas på genererade bilder.
colorsvalfritt
Typobject[]
Standard[]
Array med önskade färger.
colors[].rvalfritt
Typinteger
Standard0
0 – 255
Värdet för den röda komponenten.
colors[].gvalfritt
Typinteger
Standard0
0 – 255
Värdet för den gröna komponenten.
colors[].bvalfritt
Typinteger
Standard0
0 – 255
Värdet för den blå komponenten.
style_idvalfritt
Typstring | null
Valfri identifierare för en anpassad stilreferens.
enable_safety_checkervalfritt
Typboolean
Standardfalse
Säkerhetskontroll med en avstängd inställning som kräver kontoauktorisering. Utan sådan auktorisering kontrolleras varje begäran oavsett inställningen; true aktiverar kontrollen.
obligatoriskt

Resultat

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "recraft-20b",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 22,
    "usd": "0.022",
    "charged": 22,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200
      }
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Dina filer, ditt valVarje outputs[].url är en kopia i vår lagring: sparad för alltid (debiteras per GB-månad) eller 7 dagar kostnadsfritt, enligt din kontoinställning eller ?storage=.
Samma struktur för varje modelltype, url, content_type, width, height och duration, för bilder, video och ljud. output är modellens eget resultatobjekt.
Resultatets fält
images
array of object {url, content_type, file_name, file_size}

För AI-agenter: den här sidan som Markdown finns på https://doitong.com/sv/developers/models/recraft-20b.md. Alla modeller och guider: https://doitong.com/developers/llms.txt