{"openapi":"3.0.3","info":{"title":"RProuter API","version":"1.0.0","description":"OpenAI-compatible chat, image and speech API. Authenticate with an RProuter key (`Authorization: Bearer rp_…`). Prices are USD. Keys issued to developer apps carry only the scopes the user granted."},"servers":[{"url":"https://rprouter.ai"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"RProuter API key (rp_…)"},"oauth":{"type":"oauth2","description":"Developer apps obtain a user's key with the authorization-code flow (PKCE supported). The access token is an RProuter API key.","flows":{"authorizationCode":{"authorizationUrl":"https://rprouter.ai/oauth/authorize","tokenUrl":"https://rprouter.ai/oauth/token","scopes":{"inference":"Make chat, image and speech requests billed to your RProuter credit","balance":"See your available and reserved credit","subscription":"See whether you have an active RProuter membership","profile":"See your RProuter account ID and email address","billing":"See when you add credit and how much (not your balance or usage)","usage":"See requests made with this key"}}}}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"type":{"type":"string"}}}}}}}}}},"tags":[{"name":"Models"},{"name":"Text"},{"name":"Images"},{"name":"Audio"},{"name":"Voices"},{"name":"Account"},{"name":"Developer apps"}],"paths":{"/v1/models":{"get":{"tags":["Models"],"summary":"List available models","responses":{"200":{"description":"Models"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/chat/completions":{"post":{"tags":["Text"],"summary":"Create a chat completion (streaming supported)","security":[{"bearerAuth":[]}],"x-scope":"inference","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":180},"messages":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"anyOf":[{"type":"string","maxLength":4000000},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string","maxLength":4000000}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"]},"image_url":{"type":"object","properties":{"url":{"type":"string","maxLength":14000000},"detail":{"type":"string","enum":["auto","low","high"]}},"required":["url"]}},"required":["type","image_url"]}]}},{"type":"string","nullable":true,"enum":[null]}]},"name":{"type":"string","maxLength":100},"tool_call_id":{"type":"string","maxLength":100},"tool_calls":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]}},"required":["id","type","function"]}}},"required":["role","content"]}},"stream":{"default":false,"type":"boolean"},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"additionalProperties":false},"max_tokens":{"type":"integer","minimum":1,"maximum":131072},"max_completion_tokens":{"type":"integer","minimum":1,"maximum":131072},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"stop":{"anyOf":[{"type":"string"},{"maxItems":8,"type":"array","items":{"type":"string"}}]},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2},"presence_penalty":{"type":"number","minimum":-2,"maximum":2},"seed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tools":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"description":{"type":"string","maxLength":10000},"parameters":{"type":"object","additionalProperties":{}},"strict":{"type":"boolean"}},"required":["name","parameters"]}},"required":["type","function"]}},"tool_choice":{"anyOf":[{"type":"string","enum":["auto","none","required"]},{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["type","function"]}]},"response_format":{"type":"object","additionalProperties":{}},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["none","low","medium","high"]},"max_tokens":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":131072}}},"provider":{"type":"object","properties":{"sort":{"default":"latency","type":"string","enum":["latency","throughput","price"]},"max_price":{"type":"object","properties":{"input":{"type":"number","minimum":0},"output":{"type":"number","minimum":0}},"required":["input","output"]}}}},"required":["model","messages"],"additionalProperties":false}}}},"responses":{"200":{"description":"Completion or server-sent events"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/images/generations":{"post":{"tags":["Images"],"summary":"Generate images and wait for the result (up to 120 s)","security":[{"bearerAuth":[]}],"x-scope":"inference","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","maxLength":180},"prompt":{"type":"string","minLength":1,"maxLength":10000},"n":{"default":1,"type":"integer","minimum":1,"maximum":4},"size":{"default":"1024x1024","type":"string","enum":["1024x1024","1024x1536","1536x1024","896x1336","1336x896"]},"quality":{"default":"standard","type":"string","enum":["standard","high"]},"response_format":{"default":"url","type":"string","enum":["url","b64_json"]},"max_cost":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":10000},"image":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mask":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"provider_options":{"default":{"loras":[],"detail_refinement":false,"mode":"image-to-image","strength":0.5},"type":"object","properties":{"checkpoint":{"type":"string","pattern":"^\\d{1,30}$"},"negative_prompt":{"type":"string","maxLength":10000},"loras":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,30}$"},"strength":{"type":"number","minimum":0,"maximum":1}},"required":["id","strength"],"additionalProperties":false}},"detail_refinement":{"default":false,"type":"boolean"},"mode":{"default":"image-to-image","type":"string","enum":["image-to-image","reference","inpaint"]},"strength":{"default":0.5,"type":"number","minimum":0,"maximum":1}},"additionalProperties":false}},"required":["model","prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Images with signed /v1/media URLs"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/images/edits":{"post":{"tags":["Images"],"summary":"Edit an image (multipart files, or upload IDs from /v1/uploads)","security":[{"bearerAuth":[]}],"x-scope":"inference","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","maxLength":180},"prompt":{"type":"string","minLength":1,"maxLength":10000},"n":{"default":1,"type":"integer","minimum":1,"maximum":4},"size":{"default":"1024x1024","type":"string","enum":["1024x1024","1024x1536","1536x1024","896x1336","1336x896"]},"quality":{"default":"standard","type":"string","enum":["standard","high"]},"response_format":{"default":"url","type":"string","enum":["url","b64_json"]},"max_cost":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":10000},"image":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mask":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"provider_options":{"default":{"loras":[],"detail_refinement":false,"mode":"image-to-image","strength":0.5},"type":"object","properties":{"checkpoint":{"type":"string","pattern":"^\\d{1,30}$"},"negative_prompt":{"type":"string","maxLength":10000},"loras":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,30}$"},"strength":{"type":"number","minimum":0,"maximum":1}},"required":["id","strength"],"additionalProperties":false}},"detail_refinement":{"default":false,"type":"boolean"},"mode":{"default":"image-to-image","type":"string","enum":["image-to-image","reference","inpaint"]},"strength":{"default":0.5,"type":"number","minimum":0,"maximum":1}},"additionalProperties":false}},"required":["model","prompt"],"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","properties":{"model":{"type":"string","maxLength":180},"prompt":{"type":"string","minLength":1,"maxLength":10000},"n":{"default":1,"type":"integer","minimum":1,"maximum":4},"size":{"default":"1024x1024","type":"string","enum":["1024x1024","1024x1536","1536x1024","896x1336","1336x896"]},"quality":{"default":"standard","type":"string","enum":["standard","high"]},"response_format":{"default":"url","type":"string","enum":["url","b64_json"]},"max_cost":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":10000},"image":{"type":"string","format":"binary"},"mask":{"type":"string","format":"binary"},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"provider_options":{"type":"string","description":"JSON-encoded options"}},"required":["model","prompt","image"],"additionalProperties":false}}}},"responses":{"200":{"description":"Images"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/images/estimate":{"post":{"tags":["Images"],"summary":"Quote an image request","security":[{"bearerAuth":[]}],"x-scope":"inference","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","maxLength":180},"prompt":{"type":"string","minLength":1,"maxLength":10000},"n":{"default":1,"type":"integer","minimum":1,"maximum":4},"size":{"default":"1024x1024","type":"string","enum":["1024x1024","1024x1536","1536x1024","896x1336","1336x896"]},"quality":{"default":"standard","type":"string","enum":["standard","high"]},"response_format":{"default":"url","type":"string","enum":["url","b64_json"]},"max_cost":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":10000},"image":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mask":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"provider_options":{"default":{"loras":[],"detail_refinement":false,"mode":"image-to-image","strength":0.5},"type":"object","properties":{"checkpoint":{"type":"string","pattern":"^\\d{1,30}$"},"negative_prompt":{"type":"string","maxLength":10000},"loras":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,30}$"},"strength":{"type":"number","minimum":0,"maximum":1}},"required":["id","strength"],"additionalProperties":false}},"detail_refinement":{"default":false,"type":"boolean"},"mode":{"default":"image-to-image","type":"string","enum":["image-to-image","reference","inpaint"]},"strength":{"default":0.5,"type":"number","minimum":0,"maximum":1}},"additionalProperties":false}},"required":["model","prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Quote"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/jobs":{"post":{"tags":["Images"],"summary":"Submit a durable image job","security":[{"bearerAuth":[]}],"x-scope":"inference","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","maxLength":180},"prompt":{"type":"string","minLength":1,"maxLength":10000},"n":{"default":1,"type":"integer","minimum":1,"maximum":4},"size":{"default":"1024x1024","type":"string","enum":["1024x1024","1024x1536","1536x1024","896x1336","1336x896"]},"quality":{"default":"standard","type":"string","enum":["standard","high"]},"response_format":{"default":"url","type":"string","enum":["url","b64_json"]},"max_cost":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":10000},"image":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mask":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"provider_options":{"default":{"loras":[],"detail_refinement":false,"mode":"image-to-image","strength":0.5},"type":"object","properties":{"checkpoint":{"type":"string","pattern":"^\\d{1,30}$"},"negative_prompt":{"type":"string","maxLength":10000},"loras":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,30}$"},"strength":{"type":"number","minimum":0,"maximum":1}},"required":["id","strength"],"additionalProperties":false}},"detail_refinement":{"default":false,"type":"boolean"},"mode":{"default":"image-to-image","type":"string","enum":["image-to-image","reference","inpaint"]},"strength":{"default":0.5,"type":"number","minimum":0,"maximum":1}},"additionalProperties":false}},"required":["model","prompt"],"additionalProperties":false}}}},"responses":{"202":{"description":"Accepted job"}}},"get":{"tags":["Images"],"summary":"List recent jobs","security":[{"bearerAuth":[]}],"x-scope":"inference","responses":{"200":{"description":"Jobs"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/jobs/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Images"],"summary":"Get a job","security":[{"bearerAuth":[]}],"x-scope":"inference","responses":{"200":{"description":"Job"},"4XX":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Images"],"summary":"Cancel a job","security":[{"bearerAuth":[]}],"x-scope":"inference","responses":{"200":{"description":"Job"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/uploads":{"post":{"tags":["Images"],"summary":"Upload a reference image, mask or voice sample (kept 1 hour unless a job uses it)","security":[{"bearerAuth":[]}],"x-scope":"inference","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Upload ID, detected type and lifetime"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/media/{token}":{"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Images"],"summary":"Signed, expiring link that streams an image from the provider (no RProuter storage)","responses":{"200":{"description":"Image bytes"}}}},"/v1/audio/speech":{"post":{"tags":["Audio"],"summary":"Synthesize speech; audio streams directly from the provider","security":[{"bearerAuth":[]}],"x-scope":"inference","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","maxLength":180},"input":{"type":"string","minLength":1,"maxLength":10000},"voice":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"response_format":{"default":"mp3","type":"string","enum":["mp3","wav","pcm","opus"]},"speed":{"default":1,"type":"number","minimum":0.5,"maximum":2},"stream":{"default":true,"type":"boolean"}},"required":["model","input","voice"],"additionalProperties":false}}}},"responses":{"200":{"description":"Audio bytes"}}}},"/v1/voices":{"get":{"tags":["Voices"],"summary":"List owned and public voices","security":[{"bearerAuth":[]}],"x-scope":"inference","responses":{"200":{"description":"Voices"},"4XX":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Voices"],"summary":"Clone a private voice from an uploaded sample (uploadId) or a multipart `sample` file","security":[{"bearerAuth":[]}],"x-scope":"inference","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"consent":{"type":"boolean","enum":[true]},"consentVersion":{"type":"string","enum":["2026-09-09"]},"rights":{"type":"string","enum":["my_voice","permission_from_speaker"]}},"required":["name","uploadId","consent","consentVersion","rights"],"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"consent":{"type":"boolean","enum":[true]},"consentVersion":{"type":"string","enum":["2026-09-09"]},"rights":{"type":"string","enum":["my_voice","permission_from_speaker"]},"sample":{"type":"string","format":"binary"}},"required":["name","sample","consent","consentVersion","rights"],"additionalProperties":false}}}},"responses":{"202":{"description":"Voice"}}}},"/v1/voices/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Voices"],"summary":"Get a voice","security":[{"bearerAuth":[]}],"x-scope":"inference","responses":{"200":{"description":"Voice"},"4XX":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Voices"],"summary":"Delete a private voice","security":[{"bearerAuth":[]}],"x-scope":"inference","responses":{"200":{"description":"Voice"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/voices/search":{"post":{"tags":["Voices"],"summary":"Discover public Fish voices","security":[{"bearerAuth":[]}],"x-scope":"inference","responses":{"200":{"description":"Voices"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/balance":{"get":{"tags":["Account"],"summary":"Available and reserved credit","security":[{"bearerAuth":[]}],"x-scope":"balance","responses":{"200":{"description":"Balance"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/me":{"get":{"tags":["Account"],"summary":"The key's user, app, scopes and spending limit","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/me/subscription":{"get":{"tags":["Account"],"summary":"Whether the user has an active RProuter membership","security":[{"bearerAuth":[]}],"x-scope":"subscription","responses":{"200":{"description":"Subscription status","content":{"application/json":{"example":{"object":"subscription","plan":"premium","active":true,"status":"active","paid_until":"2026-10-28T00:00:00.000Z","current_period_end":"2026-10-28T00:00:00.000Z","cancel_at_period_end":false,"topup_fee_bps":500}}}},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/me/funding":{"get":{"tags":["Account"],"summary":"Credit the user added (net of refunds) in the last `days` days, and their latest top-up","security":[{"bearerAuth":[]}],"x-scope":"billing","parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":365,"default":30}}],"responses":{"200":{"description":"Funding","content":{"application/json":{"example":{"object":"funding","currency":"USD","window_days":30,"topped_up_usd":25,"topups":1,"last_topup_at":"2026-09-28T10:00:00.000Z","last_topup_usd":25}}}},"4XX":{"$ref":"#/components/responses/Error"}}}},"/v1/usage":{"get":{"tags":["Account"],"summary":"Requests made with this key","security":[{"bearerAuth":[]}],"x-scope":"usage","responses":{"200":{"description":"Usage"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/oauth/authorize":{"get":{"tags":["Developer apps"],"summary":"Send the user here to connect their RProuter account","parameters":[{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string"}},{"name":"response_type","in":"query","schema":{"type":"string","enum":["code"]}},{"name":"scope","in":"query","schema":{"type":"string"},"description":"Space-separated: inference, balance, subscription, profile, billing, usage"},{"name":"state","in":"query","schema":{"type":"string"}},{"name":"code_challenge","in":"query","schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","schema":{"type":"string","enum":["S256"]}},{"name":"limit_usd","in":"query","schema":{"type":"number"},"description":"Suggested spending limit"}],"responses":{"302":{"description":"Consent page"}}}},"/oauth/token":{"post":{"tags":["Developer apps"],"summary":"Exchange an authorization code for the user's app key","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type","code","redirect_uri","client_id"],"properties":{"grant_type":{"type":"string","enum":["authorization_code"]},"code":{"type":"string"},"redirect_uri":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"code_verifier":{"type":"string"}}}}}},"responses":{"200":{"description":"access_token (an rp_ key), scope, key_id, user_id, spending_limit_usd"}}}},"/topup":{"get":{"tags":["Developer apps"],"summary":"Send the user here to add credit; they return to return_to afterwards","parameters":[{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"return_to","in":"query","required":true,"schema":{"type":"string"},"description":"Same origin as one of the app's redirect URIs"}],"responses":{"302":{"description":"RProuter billing page"}}}},"/oauth/revoke":{"post":{"tags":["Developer apps"],"summary":"Revoke an app key","responses":{"200":{"description":"Revoked"}}}}}}