{"schema":"missiond.service-layer-aibot-channel.v1","name":"duowenwen","summary":"Photograph a homework question, get a 参考答案 and a 讲解 back. Billed in credits to the account behind the credential.","base_url":"https://duowenwen.ai","openapi":"https://duowenwen.ai/api/v1/openapi.json","console_url":"https://duowenwen.ai/account/api","docs_url":"https://duowenwen.ai/agent","auth":{"channels":["apikey","aibot"],"apikey":{"how":"Send the opaque key as an HTTP Bearer token over TLS.","header":"Authorization: Bearer <DUOWENWEN_API_KEY>","obtain":"Sign in at https://duowenwen.ai/login, then mint a key at https://duowenwen.ai/account/api (shown once, up to 5 active).","scopes":["homework:write","homework:read","credits:read","credits:redeem"],"secret_manager_env_name":"DUOWENWEN_API_KEY","never":"Do not place the key in a query string, a repository, a log or a chat message."},"aibot":{"how":"Exchange the agent's long-lived key for a short-lived JWT at the 印信 token endpoint, then send that JWT as the Bearer token.","token_endpoint":"https://auth.xiaojins.com/oauth2/token","grants":["urn:xjp:bot_api_key","urn:xjp:agent_api_key"],"audience":"duowenwen","capability_required":"dww:user","capability_note":"Granted by a 印信 administrator to the agent or its product grant; it delegates only the owner's own homework and wallet. Self-service bots cannot grant it themselves.","secret_manager_env_names":["DUOWENWEN_AGENT_API_KEY","DUOWENWEN_AGENT_CLIENT_SECRET"],"never":"The agent key and client secret stay in the agent runtime's secret manager. They are never sent to this API or embedded in a skill.","token_lifetime_note":"Tokens are short-lived. Mint one per run and refresh on 401."}},"actions":[{"id":"submit_homework","method":"POST","path":"/api/v1/homework","scope":"homework:write","body":"raw image bytes, or multipart/form-data with 1 to 9 image files and optional note and mode (normal or fast)","returns":"job_id, status_url","notes":"Asynchronous. A submission holds 60 credits for 1 to 3 photos, 90 for 4 to 6, 120 for 7 to 9; a failed answer is refunded. Fast mode costs 40/60/80 credits; use multipart mode=fast or X-Homework-Mode: fast. Idempotency-Key identifies retries (reuse it with identical images, note and mode)."},{"id":"get_homework","method":"GET","path":"/api/v1/homework/{id}","scope":"homework:read","returns":"status, question, reference_answer, explanation, receipt","notes":"Poll every 3 to 5 seconds until status is done or failed."},{"id":"get_credits","method":"GET","path":"/api/v1/credits","scope":"credits:read","returns":"balance, photo_credits, packs, ledger"},{"id":"redeem_code","method":"POST","path":"/api/v1/redeem","scope":"credits:redeem","body":{"code":"string"},"returns":"outcome, credits_granted, balance"}],"limits":{"max_images":9,"max_image_bytes":3145728,"rate":"60 requests per minute per credential by default; 429 with Retry-After"},"errors":{"401":"unauthenticated or invalid_credential (also a revoked key)","402":"insufficient_credits with required_credits and balance. Nothing was held; redeem a code or buy credits, then retry.","403":"insufficient_scope with required_scope","409":"consent_required: the account owner accepts the terms once in the browser","429":"rate_limited with Retry-After","503":"service_unavailable, credits_unavailable or auth_unreachable"},"safety":["Credits are real money. Do not loop submissions; one submission costs 12 or more credits.","Delegation never bypasses the owner's consent, the legal terms or the wallet.","Photos and answers are kept 7 days for follow-up questions, then deleted. Do not submit photos of people."]}