Create an application
Send only name, config and an optional status. The gateway assigns the id — the name slugified plus a six-character random suffix — and returns it as app.id; it cannot be chosen, and it cannot change once the application exists. A body that still carries id is refused with 400. API-key applications receive a one-time plaintext initial key in the response. Optional Idempotency-Key and X-Idempotency-Proof must be supplied together as independently generated 32–256 character URL-safe proofs. Save them before sending; an identical retry returns the original result. Wrong proof is 403, changed body is 409. Protected key recovery lasts 15 minutes; expired recovery never creates another resource.
The console's session cookie. Admin requests from the console also send x-console-request: 1.
In: cookie
Header Parameters
^[A-Za-z0-9_-]{32,256}$^[A-Za-z0-9_-]{32,256}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/admin/apps" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "config": { "authentication": { "type": "apple_app_attest", "end_user": { "source": "issuer", "issuer": { "jwks_url": "http://example.com", "issuer": "string", "audience": "string", "user_id_claim": "string", "required_claims": [ { "path": "string" } ], "max_token_lifetime_seconds": 1 } }, "app_attest": { "team_id": "string", "bundle_id": "string" } }, "routing": { "providers": { "mode": "all" }, "model_rewrites": { "property1": "string", "property2": "string" } } } }'{ "app": { "revision": 1, "id": "string", "name": "string", "config": { "authentication": { "type": "apple_app_attest", "end_user": { "source": "issuer", "issuer": { "jwks_url": "http://example.com", "issuer": "string", "audience": "string", "user_id_claim": "string", "token_header": "string", "required_claims": [ { "path": "string", "contains": "string", "equals": "string" } ], "max_token_lifetime_seconds": 1, "provider": "firebase", "entitlement": "revenuecat" } }, "app_attest": { "team_id": "string", "bundle_id": "string", "environments": [ "production" ] } }, "routing": { "providers": { "mode": "all", "selected": { "property1": { "allowed_paths": [ "string" ], "allowed_models": [ "string" ], "max_output_tokens": 1 }, "property2": { "allowed_paths": [ "string" ], "allowed_models": [ "string" ], "max_output_tokens": 1 } } }, "model_rewrites": { "property1": "string", "property2": "string" } }, "limits": { "per_user": { "requests": { "per_minute": 1, "per_day": 1 }, "spending": { "monthly_usd": 0 } }, "per_app": { "requests": { "per_minute": 1, "per_day": 1 }, "spending": { "monthly_usd": 0 } } }, "endpoints": { "property1": { "provider": "string", "model": "string", "api_style": "responses", "params": { "property1": null, "property2": null }, "max_output_tokens": 1, "fallback": [ { "provider": "string", "model": "string" } ] }, "property2": { "provider": "string", "model": "string", "api_style": "responses", "params": { "property1": null, "property2": null }, "max_output_tokens": 1, "fallback": [ { "provider": "string", "model": "string" } ] } } }, "status": "active", "created_at": "string", "updated_at": "string" }, "resolved": { "property1": null, "property2": null }, "config_error": "string", "api_key": null}