{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Doitong Models API","version":"2026-10-20","summary":"Image, video, audio and other AI models behind one REST interface, priced like the upstream in USD.","description":"One POST /run/{model} for every model (add ?wait= to get the result in the same call), one GET /requests/{id} for status, exact prices from POST /quote/{model}, output files on our storage (kept forever, paid per GB-month, or 7 days for free: the account setting or ?storage=) and signed webhooks. Model ids contain slashes; they are written as is in the path. Prices are API credits paid from the account's API balance: 1000 API credits = 1 USD, every price object carries the USD amount (add ?currency=rub for roubles). Typed per-model paths: this document carries the featured models by default; add ?category=<id>, ?model=<id> or ?models=all for others (the generic /run/{model_id} accepts every model of GET /models).","contact":{"name":"Doitong","url":"https://doitong.com/developers"}},"servers":[{"url":"https://api.doitong.com/v1","description":"Doitong API"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Models","description":"The model catalog."},{"name":"Run","description":"Quote and run models."},{"name":"Requests","description":"Status, results and cancellation of runs."},{"name":"Files","description":"Upload input files."},{"name":"Account","description":"API balance (API credits), key limits and file storage."},{"name":"MCP","description":"Model Context Protocol endpoint for AI agents."}],"paths":{"/models":{"get":{"operationId":"listModels","tags":["Models"],"summary":"List models","security":[],"parameters":[{"name":"q","in":"query","required":false,"description":"Words that must all appear in the id, name, maker or tags.","schema":{"type":"string"}},{"name":"category","in":"query","required":false,"description":"Category id.","schema":{"type":"string","enum":["text-to-image","image-to-image","text-to-video","image-to-video","reference-to-video","video-to-video","lipsync","upscale","background-removal","text-to-speech","speech-to-text","text-to-music","audio","video-to-audio","image-to-3d","text-to-3d","3d","training","llm","vision","other"]}},{"name":"lab","in":"query","required":false,"description":"Model maker, by name or slug (any case).","schema":{"type":"string"}},{"name":"family","in":"query","required":false,"description":"Variants group id (the family field of a model).","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"Price mode.","schema":{"type":"string","enum":["exact","measured","estimate","metered"]}},{"$ref":"#/components/parameters/Limit"},{"name":"cursor","in":"query","required":false,"description":"next_cursor of the previous page.","schema":{"type":"string"}},{"$ref":"#/components/parameters/Currency"}],"responses":{"200":{"description":"A page of models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"400":{"$ref":"#/components/responses/Error"}}}},"/models/{model_id}":{"get":{"operationId":"getModel","tags":["Models"],"summary":"Get a model","security":[],"parameters":[{"$ref":"#/components/parameters/ModelId"},{"$ref":"#/components/parameters/Currency"}],"responses":{"200":{"description":"The model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDetail"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/categories":{"get":{"operationId":"listCategories","tags":["Models"],"summary":"List categories","security":[],"responses":{"200":{"description":"Categories that have models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryList"}}}}}}},"/quote/{model_id}":{"post":{"operationId":"quoteModel","tags":["Run"],"summary":"Quote a run of any model","description":"Same body as run; returns the exact API credits and USD. A key is optional; with one the answer also says whether the API balance and the key can pay.","security":[{},{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ModelId"},{"$ref":"#/components/parameters/Currency"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelInput"}}}},"responses":{"200":{"description":"The exact price.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}}}},"/run/{model_id}":{"post":{"operationId":"runModel","tags":["Run"],"summary":"Run any model","parameters":[{"$ref":"#/components/parameters/ModelId"},{"$ref":"#/components/parameters/Wait"},{"name":"webhook_url","in":"query","required":false,"description":"https URL that receives a signed POST when the request finishes.","schema":{"type":"string","format":"uri"}},{"name":"storage","in":"query","required":false,"description":"Where the output files go: permanent (kept until deleted, paid per GB-month) or temporary (free, deleted after 7 days). Default: the account setting (GET /account → storage.mode).","schema":{"$ref":"#/components/schemas/StorageMode"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Same key + same body returns the same request instead of a second charge.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelInput"}}}},"responses":{"200":{"description":"Finished within wait, or an idempotent replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"202":{"description":"Accepted; poll GET /requests/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"402":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/requests":{"get":{"operationId":"listRequests","tags":["Requests"],"summary":"List this account's requests","parameters":[{"$ref":"#/components/parameters/Limit"},{"name":"status","in":"query","required":false,"description":"Only this status.","schema":{"$ref":"#/components/schemas/RequestStatus"}},{"name":"model","in":"query","required":false,"description":"Only this model id.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor of the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestList"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/requests/{request_id}":{"get":{"operationId":"getRequest","tags":["Requests"],"summary":"Get a request","parameters":[{"$ref":"#/components/parameters/RequestId"},{"$ref":"#/components/parameters/Wait"},{"name":"logs","in":"query","required":false,"description":"Set to 1 to include the latest log lines.","schema":{"type":"string","enum":["0","1"]}}],"responses":{"200":{"description":"The request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"404":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/requests/{request_id}/cancel":{"post":{"operationId":"cancelRequest","tags":["Requests"],"summary":"Cancel a request","parameters":[{"$ref":"#/components/parameters/RequestId"}],"responses":{"200":{"description":"Canceled (refunded), or already canceled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResult"}}}},"202":{"description":"The model is already working; cancellation was requested.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResult"}}}},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/requests/{request_id}/files":{"delete":{"operationId":"deleteRequestFiles","tags":["Requests"],"summary":"Delete a request's output files","description":"Deletes our copies of the output files now and stops their storage charge. The request keeps its URLs with storage.expired = true. Idempotent; a request still running is a 409.","parameters":[{"$ref":"#/components/parameters/RequestId"}],"responses":{"200":{"description":"The request, files deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/files":{"post":{"operationId":"createUpload","tags":["Files"],"summary":"Create an upload URL","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}}},"responses":{"201":{"description":"Upload with PUT, then pass file_url as a model input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"422":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/account":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"API balance and key limits","parameters":[{"$ref":"#/components/parameters/Currency"}],"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/account/storage":{"patch":{"operationId":"updateStorageSettings","tags":["Account"],"summary":"Set the default file storage","description":"permanent (default): output files are kept until you delete them, 100 API credits per GB per month from the API balance. temporary: free, deleted after 7 days. Applies to new requests; ?storage= on a run overrides it.","parameters":[{"$ref":"#/components/parameters/Currency"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettingsUpdate"}}}},"responses":{"200":{"description":"The storage settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageSettings"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/mcp":{"post":{"operationId":"mcp","tags":["MCP"],"summary":"MCP endpoint (JSON-RPC 2.0, Streamable HTTP)","description":"Tools: search_models, get_model, quote, run, get_request, cancel_request, list_requests, create_upload, get_account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"JSON-RPC response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"202":{"description":"Notification accepted (no body)."},"401":{"description":"No API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}}}}},"/run/flux-general/differential-diffusion":{"post":{"operationId":"runFluxGeneralDifferentialDiffusion","tags":["Run"],"summary":"Run FLUX.1 [dev] with Controlnets and Loras · Differential Diffusion","description":"FLUX.1 [dev] image edit driven by a change map that sets how strongly each region is altered Price: $0.138 / image.","parameters":[{"$ref":"#/components/parameters/Wait"},{"name":"webhook_url","in":"query","required":false,"description":"https URL that receives a signed POST when the request finishes.","schema":{"type":"string","format":"uri"}},{"name":"storage","in":"query","required":false,"description":"Where the output files go: permanent (kept until deleted, paid per GB-month) or temporary (free, deleted after 7 days). Default: the account setting (GET /account → storage.mode).","schema":{"$ref":"#/components/schemas/StorageMode"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Same key + same body returns the same request instead of a second charge.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FluxGeneralDifferentialDiffusionInput"}}}},"responses":{"200":{"description":"Finished within wait, or an idempotent replay.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Request"},{"type":"object","properties":{"output":{"anyOf":[{"$ref":"#/components/schemas/FluxGeneralDifferentialDiffusionOutput"},{"type":"null"}]}}}]}}}},"202":{"description":"Accepted; poll GET /requests/{id}.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Request"},{"type":"object","properties":{"output":{"anyOf":[{"$ref":"#/components/schemas/FluxGeneralDifferentialDiffusionOutput"},{"type":"null"}]}}}]}}}},"402":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"}}}},"/quote/flux-general/differential-diffusion":{"post":{"operationId":"quoteFluxGeneralDifferentialDiffusion","tags":["Run"],"summary":"Quote FLUX.1 [dev] with Controlnets and Loras · Differential Diffusion","description":"Price: $0.138 / image.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FluxGeneralDifferentialDiffusionInput"}}}},"responses":{"200":{"description":"The exact price.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (doitong_…) as \"Authorization: Bearer <key>\". \"X-API-Key: <key>\" also works."}},"parameters":{"ModelId":{"name":"model_id","in":"path","required":true,"description":"Model id; may contain slashes (e.g. flux/schnell), written as is.","schema":{"type":"string"}},"RequestId":{"name":"request_id","in":"path","required":true,"schema":{"type":"string","pattern":"^req_[a-z0-9]+$"}},"Limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},"Currency":{"name":"currency","in":"query","required":false,"description":"rub adds rouble amounts (rate × 1.3) next to USD; usd leaves them out. Default: rub on api.doitong.ru and doitong.ru, usd elsewhere.","schema":{"type":"string","enum":["usd","rub"]}},"Wait":{"name":"wait","in":"query","required":false,"description":"Hold the call up to this many seconds (max 20) and return the finished request if it completes in time.","schema":{"type":"number","minimum":0,"maximum":20}}},"responses":{"Error":{"description":"Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"ModelInput":{"type":"object","additionalProperties":true,"description":"The model's parameters. See GET /models/{model_id} for its input_schema."},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message"],"properties":{"type":{"type":"string","enum":["invalid_request","authentication_error","permission_error","not_found","insufficient_credits","budget_exceeded","conflict","rate_limited","upstream_error","service_unavailable","internal_error"]},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":["string","null"]},"details":{"type":"array","items":{"type":"object","properties":{"param":{"type":"string"},"message":{"type":"string"}}}},"request_id":{"type":["string","null"]},"doc_url":{"type":"string","format":"uri"}}}}},"Price":{"type":"object","description":"Unit price. 1000 API credits = 1 USD (the upstream price).","properties":{"credits":{"type":["number","null"],"description":"API credits per unit (exact prices may have decimals)."},"usd":{"type":["string","null"],"description":"USD per unit, e.g. \"0.112\"."},"rub":{"type":"string","description":"RUB per unit, only with currency=rub or on the RU hosts."},"unit":{"type":"string"},"from_credits":{"type":["integer","null"],"description":"Cheapest plausible single run, in API credits. For a metered model (charged by usage): the typical run, never above hold_credits; a run can settle lower."},"from_usd":{"type":["string","null"]},"from_rub":{"type":"string"},"display":{"type":["string","null"],"description":"e.g. \"$0.112 / second\"."},"credits_display":{"type":["string","null"],"description":"e.g. \"112 API credits / second\"."},"rub_display":{"type":"string","description":"e.g. \"≈ 14.56 ₽ / секунду\" (RU only)."},"mode":{"type":["string","null"],"enum":["exact","measured","estimate","metered",null],"description":"exact: the price is computed from the input; measured: from the length / size of the input files, read before the run; estimate: a flat price per run. All are what a run charges (POST /quote returns the exact amount). metered: charged by actual usage (tokens, seconds of generated speech, processing time) at this unit price — a run holds hold_credits at most and the rest is refunded after it."},"hold_credits":{"type":"integer","description":"metered only: the most a run with the default input can cost (POST /quote gives it for your input)."},"hold_usd":{"type":"string"},"typical_credits":{"type":"integer","description":"metered only: a typical run."},"typical_usd":{"type":"string"},"per":{"type":"string","description":"measured only: what the unit is counted on, e.g. input_video, input_audio, output_video, output_image."},"label":{"type":"string","description":"measured: e.g. \"Price per second of your input video\"; metered: \"Charged by usage\"."}}},"Model":{"type":"object","required":["id","name","category"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"lab":{"type":"string"},"category":{"type":"string"},"summary":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"output_kind":{"type":"string"},"thumbnail_url":{"type":["string","null"]},"price":{"$ref":"#/components/schemas/Price"},"docs_url":{"type":"string","format":"uri"},"family":{"type":["string","null"],"description":"Variants group (GET /models?family=)."}}},"ModelDetail":{"allOf":[{"$ref":"#/components/schemas/Model"},{"type":"object","properties":{"description":{"type":"string"},"family":{"type":["string","null"]},"input_schema":{"type":"object"},"output_schema":{"type":"object"},"required_params":{"type":"array","items":{"type":"string"}},"aliases":{"type":"object","additionalProperties":{"type":"string"}},"pricing":{"type":"object"},"example_input":{"type":"object"},"family_ids":{"type":"array","items":{"type":"string"}},"markdown_url":{"type":"string","format":"uri"}}}]},"ModelList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"Category":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}}},"CategoryList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}},"Quote":{"type":"object","required":["object","model","credits"],"properties":{"object":{"const":"quote"},"model":{"type":"string"},"credits":{"type":"integer","description":"API credits this run charges (1000 = 1 USD)."},"usd":{"type":"string","description":"The same amount in USD, e.g. \"0.56\"."},"rub":{"type":"string","description":"In roubles (rate × 1.3), only with currency=rub or on the RU hosts."},"unit":{"type":"string"},"quantity":{"type":"number"},"unit_credits":{"type":"number"},"mode":{"enum":["exact","measured","estimate","metered"],"description":"exact: priced from the input. measured: priced from the length / size of the input files, which were measured for this quote (see measurements; a run with the same files within an hour charges this). estimate: a flat price per run from the typical cost of this model. All are exactly what the run charges. metered: credits is the HOLD — the most this run can cost, debited when it starts; after the run it is settled to the actual usage and the rest is refunded automatically (see hold, typical, and the request's cost.settled)."},"hold":{"type":"object","description":"metered only: { credits, usd (, rub) } — the most the run can cost."},"typical":{"type":["object","null"],"description":"metered only: { credits, usd (, rub) } of a typical run."},"settlement":{"const":"usage","description":"metered only: the run is charged its actual usage."},"label":{"type":"string","description":"\"Price per run\", \"Estimated price per run\" or, measured, e.g. \"Price per second of your input video\"."},"measurements":{"type":"object","description":"measured only: per input param what was measured ({ seconds, width, height, fps, frames, kind })."},"display":{"type":["string","null"]},"breakdown":{"type":["string","null"]},"input":{"type":"object","description":"The normalized input that was priced."},"warnings":{"type":"array","items":{"type":"string"}},"balance_credits":{"type":"integer","description":"API balance in API credits. Only with an API key."},"balance_usd":{"type":"string","description":"Only with an API key."},"affordable":{"type":"boolean","description":"Only with an API key."},"key_budget_remaining":{"type":["integer","null"],"description":"Only with an API key; API credits; null when the key has no cap."},"top_up_url":{"type":"string","format":"uri","description":"Present when the API balance is too low."}}},"RequestStatus":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"Output":{"type":"object","required":["type","url"],"properties":{"type":{"type":"string","enum":["image","video","audio","file","3d"]},"url":{"type":"string","format":"uri"},"content_type":{"type":["string","null"]},"file_size":{"type":["integer","null"]},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"duration":{"type":["number","null"]},"stored":{"type":"boolean"},"expired":{"type":"boolean","description":"Present (true) once our copy was deleted; the URL no longer works."}}},"StorageMode":{"type":"string","enum":["permanent","temporary"]},"StorageSettingsUpdate":{"type":"object","required":["mode"],"additionalProperties":false,"properties":{"mode":{"$ref":"#/components/schemas/StorageMode"}}},"RequestStorage":{"type":"object","description":"Where the output files are kept (DESIGN.md §17).","properties":{"mode":{"$ref":"#/components/schemas/StorageMode"},"bytes":{"type":"integer","description":"Bytes of our copies of the output files."},"expires_at":{"type":["string","null"],"format":"date-time","description":"When the files are deleted (temporary); null when kept until you delete them."},"expired":{"type":"boolean","description":"true once the files were deleted."}}},"StorageSettings":{"type":"object","properties":{"object":{"type":"string","description":"\"storage_settings\" from PATCH /account/storage."},"mode":{"$ref":"#/components/schemas/StorageMode"},"price_credits_per_gb_month":{"type":"integer","description":"API credits per GB (1024^3 bytes) per month of permanent storage."},"price_usd_per_gb_month":{"type":"string"},"price_rub_per_gb_month":{"type":"string","description":"Only with currency=rub or on the RU hosts."},"temporary_retention_days":{"type":"integer"},"used_bytes":{"type":"integer","description":"Bytes kept permanently (billed)."},"used_gb":{"type":"string"},"expiring_bytes":{"type":"integer","description":"Bytes waiting to be deleted."},"monthly_estimate_credits":{"type":"integer"},"monthly_estimate_usd":{"type":"string"},"grace_started_at":{"type":["string","null"],"format":"date-time","description":"The API balance stopped covering storage at this time."},"grace_until":{"type":["string","null"],"format":"date-time","description":"Top up before this time, or the permanent files become temporary."}}},"Request":{"type":"object","required":["id","object","model","status"],"properties":{"id":{"type":"string"},"object":{"const":"request"},"model":{"type":"string"},"status":{"$ref":"#/components/schemas/RequestStatus"},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"queue_position":{"type":["integer","null"]},"cost":{"type":"object","description":"API credits (1000 = 1 USD).","properties":{"credits":{"type":"integer","description":"The quoted price (metered: the hold)."},"usd":{"type":"string","description":"The quoted price in USD."},"charged":{"type":"integer","description":"Debited from the API balance."},"refunded":{"type":"integer","description":"Given back (failure, cancel, or the unused part of a metered hold)."},"mode":{"const":"metered","description":"Only on metered requests."},"held":{"type":"integer","description":"metered only: the hold debited at the start."},"typical":{"type":"integer","description":"metered only: a typical run, API credits."},"settled":{"type":["object","null"],"description":"metered only, once the request succeeded: status settled (credits = what the usage cost = charged − refunded), pending, or no_usage (the model reported no usage: the hold stands).","properties":{"status":{"enum":["settled","pending","no_usage"]},"credits":{"type":"integer"},"usd":{"type":"string"},"quantity":{"type":"number","description":"Usage units billed."},"unit":{"type":"string","description":"e.g. 1000_tokens, audio_second, compute_second."},"unit_usd":{"type":"string"},"source":{"enum":["billed_usage","processing_time"]},"approximate":{"type":"boolean","description":"true when measured from the processing time."}}}}},"input":{"type":"object"},"output":{"type":["object","null"]},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/Output"}},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"metrics":{"type":["object","null"]},"storage":{"$ref":"#/components/schemas/RequestStorage"},"logs":{"type":"array","items":{"type":"object"}},"urls":{"type":"object","properties":{"self":{"type":"string","format":"uri"},"cancel":{"type":"string","format":"uri"}}}}},"RequestList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Request"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"CancelResult":{"allOf":[{"$ref":"#/components/schemas/Request"},{"type":"object","properties":{"cancel_requested":{"type":"boolean"}}}]},"UploadRequest":{"type":"object","required":["filename"],"properties":{"filename":{"type":"string","description":"The extension decides the type (jpg, png, webp, mp4, mov, webm)."},"content_type":{"type":"string"},"size":{"type":"integer","minimum":1,"description":"Bytes."}}},"Upload":{"type":"object","properties":{"object":{"const":"upload"},"upload_url":{"type":"string","format":"uri"},"file_url":{"type":"string","format":"uri"},"method":{"const":"PUT"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"content_type":{"type":"string"},"expires_in":{"type":"integer"},"max_bytes":{"type":"integer"}}},"Account":{"type":"object","properties":{"object":{"const":"account"},"credits":{"type":"integer","description":"API balance in API credits (1000 = 1 USD). Separate from the Doitong app credits."},"balance":{"type":"object","properties":{"credits":{"type":"integer"},"usd":{"type":"string"},"rub":{"type":"string","description":"Only with currency=rub or on the RU hosts."}}},"top_up_url":{"type":"string","format":"uri"},"key":{"type":"object","properties":{"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"budget_remaining":{"type":["integer","null"],"description":"API credits; null: no cap on the key, the API balance is the limit."},"rate_limit":{"type":"integer"},"rate_limit_remaining":{"type":"integer"}}},"webhook_signing_secret":{"type":"string","description":"HMAC-SHA256 secret of the Doitong-Signature header."},"storage":{"$ref":"#/components/schemas/StorageSettings"}}},"JsonRpcRequest":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer","null"]},"method":{"type":"string"},"params":{"type":"object"}}},"JsonRpcResponse":{"type":"object","required":["jsonrpc"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer","null"]},"result":{"type":"object"},"error":{"type":"object"}}},"FluxGeneralDifferentialDiffusionInput":{"properties":{"base_shift":{"default":0.5,"description":"Baseline shift applied to scheduled timesteps.","maximum":5,"minimum":0.01,"title":"Base Shift","type":"number"},"change_map_image_url":{"description":"URL pointing to the change map.","title":"Change Map URL","type":"string"},"control_loras":{"default":[],"description":"Control-image LoRAs merged into a combined configuration for generating the final image; the number supplied is unrestricted.","items":{"properties":{"control_image_url":{"description":"Image URL supplying the control image.","title":"Control Image Url","type":"string"},"path":{"description":"Location of the LoRA weights, specified as a URL or path.","title":"Path","type":"string"},"preprocess":{"default":"None","description":"Preprocessing method applied to the supplied image.","enum":["canny","depth","None"],"title":"Preprocess","type":"string"},"scale":{"anyOf":[{"additionalProperties":{"maximum":4,"minimum":-4,"type":"number"},"examples":[{"transformer":0.8}],"title":"Per-layer LoRA scales","type":"object"},{"examples":[1],"maximum":4,"minimum":-4,"title":"Uniform LoRA scale","type":"number"}],"default":1,"description":"Scaling applied to LoRA weights before they are merged into the base model. Supply a dictionary of the form {\"layer_name\":layer_scale} to set individual layer scales; unspecified layers use 1.0.","title":"Scale"}},"required":["path","control_image_url"],"title":"ControlLoraWeight","type":"object","x-doitong-order":["path","scale","control_image_url","preprocess"]},"title":"Control Loras","type":"array"},"controlnet_unions":{"default":[],"description":"ControlNet union configuration for image generation, subject to the current single-ControlNet restriction.","items":{"properties":{"config_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL pointing to the ControlNet's config.json file.","title":"Config Url"},"controls":{"description":"Control images and associated modes supplied to the ControlNet.","items":{"properties":{"conditioning_scale":{"default":1,"description":"Scaling applied to ControlNet weights before they are merged into the base model.","maximum":2,"minimum":0,"title":"Conditioning Scale","type":"number"},"control_image_url":{"description":"Image URL supplying the control image.","title":"Control Image Url","type":"string"},"control_mode":{"description":"Control mode used by Flux Controlnet Union. Options: canny guides generation with edges; tile guides it with tiles; depth guides it with a grayscale depth map; blur blurs the image; pose guides generation with the image's pose; gray makes the image grayscale; low-quality produces a low-quality version of the image.","enum":["canny","tile","depth","blur","pose","gray","low-quality"],"title":"Control Mode","type":"string"},"end_percentage":{"default":1,"description":"Percentage of total timesteps at which ControlNet stops influencing image generation.","maximum":1,"minimum":0,"title":"End Percentage","type":"number"},"mask_image_url":{"description":"Mask URL associated with the control image.","title":"Mask Image Url","type":"string"},"mask_threshold":{"default":0.5,"description":"Mask threshold value.","maximum":0.99,"minimum":0.01,"title":"Mask Threshold","type":"number"},"start_percentage":{"default":0,"description":"Percentage of total timesteps at which ControlNet starts influencing image generation.","maximum":1,"minimum":0,"title":"Start Percentage","type":"number"}},"required":["control_image_url","control_mode"],"title":"ControlNetUnionInput","type":"object","x-doitong-order":["control_image_url","mask_image_url","control_mode","conditioning_scale","mask_threshold","start_percentage","end_percentage"]},"title":"Controls","type":"array"},"path":{"description":"ControlNet weight location, specified as a URL or path.","title":"Path","type":"string"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional variant for use with a Hugging Face repository key.","title":"Variant"}},"required":["path","controls"],"title":"ControlNetUnion","type":"object","x-doitong-order":["path","config_url","variant","controls"]},"title":"Controlnet Unions","type":"array"},"controlnets":{"default":[],"description":"ControlNet configuration for image generation, currently limited to a single ControlNet.","items":{"properties":{"conditioning_scale":{"default":1,"description":"Scaling applied to ControlNet weights before they are merged into the base model.","maximum":2,"minimum":0,"title":"Conditioning Scale","type":"number"},"config_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL pointing to the ControlNet's config.json file.","title":"Config Url"},"control_image_url":{"description":"Image URL supplying the control image.","title":"Control Image Url","type":"string"},"end_percentage":{"default":1,"description":"Percentage of total timesteps at which ControlNet stops influencing image generation.","maximum":1,"minimum":0,"title":"End Percentage","type":"number"},"mask_image_url":{"description":"Mask URL associated with the control image.","title":"Mask Image Url","type":"string"},"mask_threshold":{"default":0.5,"description":"Mask threshold value.","maximum":0.99,"minimum":0.01,"title":"Mask Threshold","type":"number"},"path":{"description":"ControlNet weight location, specified as a URL or path.","title":"Path","type":"string"},"start_percentage":{"default":0,"description":"Percentage of total timesteps at which ControlNet starts influencing image generation.","maximum":1,"minimum":0,"title":"Start Percentage","type":"number"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional variant for use with a Hugging Face repository key.","title":"Variant"}},"required":["path","control_image_url"],"title":"ControlNet","type":"object","x-doitong-order":["path","config_url","variant","control_image_url","mask_image_url","mask_threshold","conditioning_scale","start_percentage","end_percentage"]},"title":"Controlnets","type":"array"},"easycontrols":{"default":[],"description":"EasyControl inputs applied during image generation.","items":{"properties":{"control_method_url":{"description":"Control method's safetensor weight URL, or a supported identifier: `canny`, `depth`, `hedsketch`, `inpainting`, `pose`, `seg`, `subject`, `ghibli`.","examples":["canny","depth","hedsketch","inpainting","pose","seg","subject","ghibli"],"title":"Control Method Url","type":"string"},"image_control_type":{"description":"Image control mode; accepts either `spatial` or `subject`.","enum":["subject","spatial"],"title":"Image Control Type","type":"string"},"image_url":{"description":"Image URL supplying a control input.","title":"Image Url","type":"string"},"scale":{"default":1,"description":"Control method scaling factor.","maximum":2,"minimum":0,"title":"Scale","type":"number"}},"required":["control_method_url","image_url","image_control_type"],"title":"EasyControlWeight","type":"object","x-doitong-order":["control_method_url","scale","image_url","image_control_type"]},"title":"Easycontrols","type":"array"},"enable_safety_checker":{"default":true,"description":"Safety checking, which returns black images in place of any images flagged unsafe. A value of true enables checking; false disables it only for authorized accounts, while requests without authorization are checked regardless.","title":"Enable Safety Checker","type":"boolean"},"fill_image":{"anyOf":[{"properties":{"fill_image_url":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"default":[],"description":"Image URLs for filling via redux prompting.","title":"Fill Image Url"}},"title":"ImageFillInput","type":"object","x-doitong-order":["fill_image_url"]},{"type":"null"}],"description":"Input image that guides generation and can supply content for masked regions."},"guidance_scale":{"default":3.5,"description":"Prompt-adherence strength for image selection, expressed as CFG (Classifier Free Guidance).","maximum":20,"minimum":0,"title":"Guidance scale (CFG)","type":"number"},"image_size":{"anyOf":[{"properties":{"height":{"default":512,"description":"The height of the generated image.","exclusiveMinimum":0,"maximum":14142,"title":"Height","type":"integer"},"width":{"default":512,"description":"The width of the generated image.","exclusiveMinimum":0,"maximum":14142,"title":"Width","type":"integer"}},"title":"ImageSize","type":"object","x-doitong-order":["width","height"]},{"enum":["square_hd","square","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],"type":"string"}],"description":"Dimensions of the generated image.","title":"Image Size"},"image_url":{"description":"Image URL supplying the initial image.","title":"Image URL","type":"string","x-doitong-alias":"image"},"ip_adapters":{"default":[],"description":"IP-Adapter applied during image generation.","items":{"properties":{"image_encoder_path":{"description":"IP-Adapter image encoder location, such as 'openai/clip-vit-large-patch14'.","title":"Image Encoder Path","type":"string"},"image_encoder_subfolder":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Subfolder containing weights for the image encoder.","title":"Image Encoder Subfolder"},"image_encoder_weight_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Image encoder name.","title":"Image Encoder Weight Name"},"image_url":{"description":"Conditioning image URL supplied to the IP-Adapter.","title":"Image Url","type":"string"},"mask_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mask URL associated with the control image.","title":"Mask Image Url"},"mask_threshold":{"default":0.5,"description":"Mask threshold value.","maximum":0.99,"minimum":0.01,"title":"Mask Threshold","type":"number"},"path":{"description":"IP-Adapter location on Hugging Face.","title":"Path","type":"string"},"scale":{"description":"IP-Adapter scaling factor.","title":"Scale","type":"number"},"subfolder":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Subfolder containing the ip_adapter weights.","title":"Subfolder"},"weight_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Safetensors filename for the IP-Adapter's weights.","title":"Weight Name"}},"required":["path","image_encoder_path","image_url","scale"],"title":"IPAdapter","type":"object","x-doitong-order":["path","subfolder","weight_name","image_encoder_path","image_encoder_subfolder","image_encoder_weight_name","image_url","mask_image_url","mask_threshold","scale"]},"title":"Ip Adapters","type":"array"},"loras":{"default":[],"description":"LoRAs whose combined effect produces the generated image, with no limit on how many you supply.","items":{"properties":{"path":{"description":"Location of the LoRA weights, specified as a URL or path.","title":"Path","type":"string"},"scale":{"anyOf":[{"additionalProperties":{"maximum":4,"minimum":-4,"type":"number"},"examples":[{"transformer":0.8}],"title":"Per-layer LoRA scales","type":"object"},{"examples":[1],"maximum":4,"minimum":-4,"title":"Uniform LoRA scale","type":"number"}],"default":1,"description":"Scaling applied to LoRA weights before they are merged into the base model. Supply a dictionary of the form {\"layer_name\":layer_scale} to set individual layer scales; unspecified layers use 1.0.","title":"Scale"}},"required":["path"],"title":"LoraWeight","type":"object","x-doitong-order":["path","scale"]},"title":"Loras","type":"array"},"max_shift":{"default":1.15,"description":"Maximum shift applied to scheduled timesteps.","maximum":5,"minimum":0.01,"title":"Max Shift","type":"number"},"nag_alpha":{"default":0.25,"description":"NAG alpha sets how much the positive prompt redirects normalized guidance combining the positive and negative prompts. This final weighting gives the positive prompt more influence at lower settings and reduces redirection at higher settings.","exclusiveMinimum":0,"maximum":1,"title":"NAG alpha","type":"number"},"nag_end":{"default":0.25,"description":"NAG cutoff expressed as a proportion of the generation steps. FLUX's original attention processors take over after NAG has run for that initial proportion.","exclusiveMinimum":0,"maximum":1,"title":"Proportion of steps to apply NAG","type":"number"},"nag_scale":{"default":3,"description":"Negative-prompt avoidance controlled by the NAG scale: increasing it makes the generated image less like the negative description.","exclusiveMinimum":1,"maximum":10,"title":"NAG scale","type":"number"},"nag_tau":{"default":2.5,"description":"NAG tau setting for hidden-state normalization; leaving it unchanged is recommended. Raising it weakens normalization and risks unexpected departures from the original image.","exclusiveMinimum":0,"title":"NAG Tau","type":"number"},"negative_prompt":{"default":"","description":"Negative prompt processed with NAG by default to discourage the specified unwanted features in generated images.","title":"Negative Prompt","type":"string"},"num_images":{"default":1,"description":"Set how many images to generate; this choice is fixed at 1 when output is streamed.","maximum":10,"minimum":1,"title":"Num Images","type":"integer","x-doitong-alias":"num_outputs"},"num_inference_steps":{"default":28,"description":"Count of inference steps to run.","maximum":50,"minimum":1,"title":"Num Inference Steps","type":"integer"},"output_format":{"default":"png","description":"File format for the resulting image.","enum":["jpeg","png"],"title":"Output Format","type":"string"},"prompt":{"description":"Prompt that guides image generation.","examples":["Tree of life under the sea, ethereal, glittering, lens flares, cinematic lighting, artwork by Anna Dittmann & Carne Griffiths, 8k, unreal engine 5, hightly detailed, intricate detailed."],"title":"Prompt","type":"string"},"real_cfg_scale":{"default":3.5,"description":"Prompt-adherence strength for image selection, expressed as CFG (Classifier Free Guidance).","maximum":5,"minimum":0,"title":"Real CFG scale","type":"number"},"reference_end":{"default":1,"description":"Reference guidance end point, expressed as a percentage of all timesteps.","maximum":1,"minimum":0,"title":"Reference End","type":"number"},"reference_image_url":{"description":"Image URL used for Reference-Only guidance.","title":"Reference Image Url","type":"string"},"reference_start":{"default":0,"description":"Reference guidance start point, expressed as a percentage of all timesteps.","maximum":1,"minimum":0,"title":"Reference Start","type":"number"},"reference_strength":{"default":0.65,"description":"Reference-image influence during reference_only generation; without a supplied reference image, this strength setting has no effect.","maximum":3,"minimum":-3,"title":"Reference Strength","type":"number"},"scheduler":{"default":"euler","description":"Scheduler used during denoising.","enum":["euler","dpmpp_2m"],"title":"Scheduler","type":"string"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Seed for reproducible images: an identical prompt and seed produce an identical image when the model version is unchanged.","title":"Seed"},"sigma_schedule":{"anyOf":[{"const":"sgm_uniform","type":"string"},{"type":"null"}],"description":"Sigma schedule used during denoising.","title":"Sigma Schedule"},"strength":{"default":0.85,"description":"Differential diffusion strength, spanning preservation of the original at 0.0 to a complete remake at 1.0.","maximum":1,"minimum":0.01,"title":"Strength","type":"number"},"use_beta_schedule":{"default":false,"description":"Controls whether to use beta sigmas.","title":"Use Beta Schedule","type":"boolean"},"use_cfg_zero":{"default":false,"description":"Enables CFG-zero initialization sampling, described at https://arxiv.org/abs/2503.18886.","title":"Use CFG-Zero-Init","type":"boolean"},"use_real_cfg":{"default":false,"description":"Classical CFG switch, automatically enabled with XLabs IP-Adapter v1. The guidance behavior matches that of models such as SD1.5 and SDXL.","title":"Use Real CFG","type":"boolean"}},"required":["prompt","image_url","change_map_image_url"],"title":"DifferentialDiffusionInput","type":"object","x-doitong-order":["prompt","image_size","num_inference_steps","seed","loras","control_loras","controlnets","controlnet_unions","ip_adapters","easycontrols","fill_image","guidance_scale","real_cfg_scale","use_real_cfg","use_cfg_zero","num_images","enable_safety_checker","reference_image_url","reference_strength","reference_start","reference_end","base_shift","max_shift","output_format","use_beta_schedule","sigma_schedule","scheduler","negative_prompt","nag_scale","nag_tau","nag_alpha","nag_end","image_url","change_map_image_url","strength"]},"FluxGeneralDifferentialDiffusionOutput":{"properties":{"has_nsfw_concepts":{"description":"Indicates whether NSFW concepts appear in the generated images.","items":{"type":"boolean"},"title":"Has Nsfw Concepts","type":"array"},"images":{"description":"File information for the generated images.","items":{"properties":{"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"image/jpeg","title":"Content Type"},"height":{"title":"Height","type":"integer"},"url":{"title":"Url","type":"string"},"width":{"title":"Width","type":"integer"}},"required":["url","width","height"],"title":"Image","type":"object","x-doitong-order":["url","width","height","content_type"]},"title":"Images","type":"array"},"prompt":{"description":"Prompt used during image generation.","title":"Prompt","type":"string"},"seed":{"description":"Image-generation seed, including the randomly chosen value if the input omitted a seed; otherwise, it repeats the supplied value.","title":"Seed","type":"integer"},"timings":{"additionalProperties":{"type":"number"},"title":"Timings","type":"object"}},"required":["images","timings","seed","has_nsfw_concepts","prompt"],"title":"Output","type":"object","x-doitong-order":["images","timings","seed","has_nsfw_concepts","prompt"]}}}}