Dža ko lil
Sar te startis

Sigo sar te startis

Dikh sar Markdown Nevo

Ker tuthi angluni keripe jekhe cikne minutenca. Sa 1,496 modelo len jekhfalo mangipen thaj den palpale jekh mangipnasqo objektos, vaš kipo, video thaj audio: sikľuv les jekhvar kate.

1. Len jekh API klidin

Ker jekh klidin ko https://doitong.com/developers/dashboard#keys thaj garav les andre jekh environment variable: sikavel pes numa jekhvar. Sako klidin šaj te lel pesqo budžeto, vašoda šaj les te des jekhe agentoske bizo te riskines sa o khonto. GET /account sikavel tutho API balanso.

export DOITONG_API_KEY="doitong_..."

curl "https://api.doitong.com/v1/account" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

O keripena pes pokinen andar tutho kontosqo API balanso andre API krediti: 1,000 API krediti = $1, thaj sako modelo kostet precizno lesqe kerimasqo gindipen. Pher tutho balanso ko https://doitong.com/developers/dashboard#balance.

2. Gin, palem ker

POST /quote/{model_id} lel o inputo JSON thaj del tut precizno mol. Na mangel klidin thaj na kostet nič. O keripe sagda inputosqo kostet akor: o gindipen si o pokin. (Jekh modelo, savo pokinel palem labaripen, si o jekh wyjątko: lesqo gindipen si o barvalipen so o keripe šaj te kostet, thaj o na-labardo kotor irinel pes palal o keripe.)

curl -X POST "https://api.doitong.com/v1/quote/kling-video/v3/pro/image-to-video" \
  -H "Content-Type: application/json" \
  -d '{"image": "https://example.com/fox.jpg", "duration": 5, "generate_audio": true}'
200 OK · gindipen
{
  "object": "quote",
  "model": "kling-video/v3/pro/image-to-video",
  "credits": 840,
  "usd": "0.84",
  "unit": "second",
  "quantity": 5,
  "unit_credits": 168,
  "mode": "exact",
  "breakdown": "5 s × 168 API credits"
}

Palem bičhal tuti jekhfalo body ko POST /run/{model_id}. Thov ?wait=20 te garaves o konekcia vaj ko 20 sekunda: jekh sigo modelo del o agorutno rezultato andre jekh round trip. Bičhal jekh Idempotency-Key header, te retry na kerel (vaj na pokinel) dujvar.

curl -X POST "https://api.doitong.com/v1/run/flux/schnell?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: lighthouse-001" \
  -d '{"prompt": "A lighthouse on a rocky coast at dusk, warm light in the window"}'

O odpoveda si jekh mangipnasqo objektos:

200 OK · mangipen
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "flux/schnell",
  "status": "succeeded",
  "cost": { "credits": 3, "usd": "0.003", "charged": 3, "refunded": 0 },
  "outputs": [
    { "type": "image", "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg", "width": 1024, "height": 768, "stored": true }
  ],
  "error": null
}

3. Dikh o status

Te o modelo ajci kerel buti kana agoril o vakti, les tut 202 Accepted le mangipnasqe id thaj lesqo akto status. Sako mangipen džal tele jekhfalo lifecycle:

Dživipen e mangipnasqo
  1. queued Lelilo thaj plaćime, azhukerel bućakoro
  2. running O modelo kerel
  3. Palune statusura:
    • succeededPokinime o citato; outputs[] si len URL-e amare arkhivoske
    • failedVracime automatikane; o error phenel soske
    • canceledAčhilo angle rezultatestar; vracime

Gin palem o mangipen lesqe idesa. ?wait=20 kerel buti vi kate, vašoda jekh sasto loop si dosta:

curl "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Kana status si succeeded, outputs[].url inkrel linkura ko fajlo amare arakhipnaste. Te o mangipen failed vaj sas canceled, lesqe API krediti irinen pes avtomaticko thaj error phenel soske. Canceľin sa so ajci si queued vaj running:

terminalo
curl -X POST "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Vaš bare video keripena šaj te mukes o polling thaj te bičhalel webhook_url (dikh Webhooks).

4. Fajlo

Bičhal sajekh publike URL sar inputo, vaj mang POST /files vaš jekh upload URL, PUT o fajlo odothe thaj lačhar o palpale file_url (dikh Files). Jekh mangipen savo agorisardilo sikavel lesqe rezultatura andre outputs[] le typesa, content typesa thaj, kana džanel pes, dimenzijenca thaj durata.

terminalo
curl -X POST "https://api.doitong.com/v1/files" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename": "fox.jpg", "content_type": "image/jpeg", "size": 482113}'

Greškipena

Sako modelo našťi kerel jekhfalo: jekh envelope le type, jekhe precizne code, o problematikane param thaj sako problem andre details, vašoda jekh agento šaj te lačharel o mangipen bizo te ginel proza. Na pokinel pes nič vaš invalidno mangipen.

422 Unprocessable Entity
{
  "error": {
    "type": "invalid_request",
    "code": "invalid_input",
    "message": "duration must be one of 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15.",
    "param": "duration",
    "details": [ { "param": "duration", "message": "duration must be one of 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15." } ],
    "request_id": null,
    "doc_url": "https://doitong.com/developers/docs/errors#invalid_input"
  }
}

Sako type thaj code si listome andre Errors.

Mol

O mola si andre USD thaj API krediti thaj sikaven pes pro sako modelosqi pagina angla tu te keres. Sako mangipen anel cost le credits, usd, charged thaj refunded. Jekh keripe pokinel pes kana les lel pes; failed thaj canceled mangipena irinen pes avtomaticko. Važno modelo molin pes precizno pala o inputo, varesave pala o lungipen vaj baripen le fajlengo so tu bičhales, avera pokinen jekh gindime mol vaš keripe: sar te na avel, o gindipen si so tu pokines. Cikne modelo (čhibake thaj vision modelo, lavutne, sadhana vaš procesamiento-vakto) pokinena palem labaripen: o gindipen si o barvalipen so o keripe šaj te kostel, thaj o kotor so o keripe na labardas irinel pes avtomaticko. Dikh Pricing.

MCP thaj AI agento

Konektil sa MCP client ko https://api.doitong.com/v1/mcp le jekhe Bearer klidinesa. Tiro agento šaj te rodavel andro katalogo, te gindil thaj te kerel modelo, thaj te ginel sako dokumentacia-pagina sar Markdown.

Claude Code
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Palune faze