ข้ามไปยังเนื้อหา

Recraft 20b

ผสานการทำงาน

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"

คำขอนี้: $0.022 22 เครดิต API · ≈ ₽2.32 เรียกใช้ในหน้านี้

รับคีย์ API
Recraft ข้อความเป็นภาพ #image-generation#vector-art#typograph#style

โมเดลสร้างภาพจากข้อความที่มีสไตล์ให้เลือกมากมาย รวมถึงภาพประกอบเวกเตอร์และดิจิทัล พร้อมคำแนะนำด้านสี

Recraft · ภาพ

ผลลัพธ์แรกของคุณจะแสดงที่นี่

สร้างคำขอด้านล่างและเรียกใช้ด้วยคีย์ API ของคุณ เอาต์พุตจะถูกคัดลอกไปยังพื้นที่จัดเก็บของเรา และเก็บไว้ตลอดไปหรือฟรี 7 วัน

สร้างคำขอ

ตัวควบคุมสร้างจากสคีมาของโมเดล โค้ดและราคาจะอัปเดตเมื่อคุณเปลี่ยนค่า

•จำเป็น 88 / 1000
image_size ค่าเริ่มต้น square_hd
ค่าเริ่มต้น realistic_image

สไตล์ภาพที่ใช้กับรูปภาพที่สร้างขึ้น

ขั้นสูง style_id · enable_safety_checker · colors

ตัวระบุเสริมสำหรับข้อมูลอ้างอิงสไตล์แบบกำหนดเอง

ค่าเริ่มต้น []

อาร์เรย์ที่มีสีที่ต้องการ

POST /run/recraft-20b?wait=20 ใบเสนอราคา → $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"

เรียกใช้คำขอนี้

คีย์ของคุณจะอยู่ในเบราว์เซอร์นี้ โดยส่งไปยัง Doitong API เท่านั้น และจะบันทึกใน localStorage ก็ต่อเมื่อคุณเลือกจดจำ รับคีย์ API

เกี่ยวกับ Recraft 20b

สร้างรูปภาพจากพรอมต์สูงสุด 1000 อักขระ พารามิเตอร์ `style` มีตัวเลือกจำนวนมากสำหรับรูปภาพเสมือนจริง ภาพประกอบดิจิทัล และภาพประกอบเวกเตอร์ ส่วน `style_id` ใช้อ้างอิงสไตล์แบบกำหนดเอง อาร์เรย์ `colors` ใช้แนะนำสีที่ต้องการ และ `image_size` มีพรีเซ็ตแบบสี่เหลี่ยมจัตุรัส แนวตั้ง และแนวนอน

พารามิเตอร์

ชื่อประเภท ค่าเริ่มต้นค่าที่อนุญาต คำอธิบาย
promptจำเป็น
ประเภทstring
≤ 1,000 อักขระ
image_sizeไม่บังคับ
ประเภทobject
ค่าเริ่มต้นsquare_hd
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
styleไม่บังคับ
ประเภทenum
ค่าเริ่มต้นrealistic_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 ค่าdigital_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
สไตล์ภาพที่ใช้กับรูปภาพที่สร้างขึ้น
colorsไม่บังคับ
ประเภทobject[]
ค่าเริ่มต้น[]
อาร์เรย์ที่มีสีที่ต้องการ
colors[].rไม่บังคับ
ประเภทinteger
ค่าเริ่มต้น0
0 – 255
ค่าขององค์ประกอบสีแดง
colors[].gไม่บังคับ
ประเภทinteger
ค่าเริ่มต้น0
0 – 255
ค่าขององค์ประกอบสีเขียว
colors[].bไม่บังคับ
ประเภทinteger
ค่าเริ่มต้น0
0 – 255
ค่าขององค์ประกอบสีน้ำเงิน
style_idไม่บังคับ
ประเภทstring | null
ตัวระบุเสริมสำหรับข้อมูลอ้างอิงสไตล์แบบกำหนดเอง
enable_safety_checkerไม่บังคับ
ประเภทboolean
ค่าเริ่มต้นfalse
สวิตช์ตรวจสอบความปลอดภัย ซึ่งการตั้งค่าเป็นปิดต้องได้รับอนุญาตจากบัญชี หากไม่มีการอนุญาตดังกล่าว ทุกคำขอจะได้รับการตรวจสอบโดยไม่คำนึงถึงการตั้งค่า; true จะเปิดใช้ตัวตรวจสอบ
จำเป็น

เอาต์พุต

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"
  }
}
ไฟล์ของคุณ คุณเลือกเองทุก outputs[].url คือสำเนาบนพื้นที่จัดเก็บของเรา: เก็บไว้ตลอดไป (คิดค่าบริการต่อ GB-เดือน) หรือฟรี 7 วัน โดยกำหนดได้ในการตั้งค่าบัญชีหรือ ?storage=
รูปแบบเดียวกันในทุกโมเดลtype, url, content_type, width, height และ duration สำหรับภาพ วิดีโอ และเสียงเหมือนกันทั้งหมด ส่วน output คือออบเจ็กต์ผลลัพธ์ของโมเดลเอง
ฟิลด์ของเอาต์พุต
images
array of object {url, content_type, file_name, file_size}

สำหรับเอเจนต์ AI: หน้า Markdown นี้อยู่ที่ https://doitong.com/th/developers/models/recraft-20b.md. โมเดลและคู่มือทั้งหมด: https://doitong.com/developers/llms.txt