API reference
Developer runtime reference.
Use the OpenAPI 3.1.0 document and JSON Schema to implement chat, request recovery, session management, privacy and sandbox operations for the project-planning demo and runtime APIs.
Integrating the Conversations API? Use its integration guide and OpenAPI document.
Keep the schema under a sibling schemas directory when importing the OpenAPI document. Contract version 2026-12-01 identifies the supported wire version; it is not a deployment date.
POST /v1/chat
Base origin: https://developers-api-staging.foreverlearning.ai. Authenticate with Authorization: Bearer <server-held staging key> and send JSON. Chat requires a current assignment and the chat scope.
| Header | Required | Meaning |
|---|---|---|
X-User-Id | Yes | Your opaque end-user identifier, scoped to this organization and assignment. Leading/trailing whitespace is trimmed. |
X-Assignment-Id | Conditional / optional | Exact granted assignment. Omit only when key resolution can select one unambiguously. |
FL-API-Version | Conditional / optional | Omission selects this version; other values are refused. |
Idempotency-Key | Conditional / optional | Keep the same value and original body for retries. Different input for an existing intent is refused with 422 IDEMPOTENCY_KEY_REUSED. Without it a new durable request ID is allocated. |
Body fields: prompt, session_id, context, reengage, system_message. Unknown fields are refused. Ordinary turns supply a string prompt; reengagement requires an existing session and uses a governed greeting.
Prompts allow at most 10,000 UTF-16 code units. Context allows at most 24,576 UTF-8 bytes after JSON serialization, with additional nesting and delimiter checks. The assigned release can impose tighter limits on the complete provider request. JSON Schema character counts alone do not enforce these runtime bounds.
Responses
| HTTP status | Content types |
|---|---|
200 | text/event-stream |
400 | application/json |
401 | application/json |
402 | application/json |
403 | application/json |
409 | application/json |
422 | application/json |
429 | application/json |
503 | application/json |
default | application/json |
HTTP 200 does not by itself establish a completed turn. Follow the stream completion rules and retain the final commercial receipt. Error codes and response fields can grow; clients must tolerate compatible additions.
Source provenance
This reference is generated from committed API sources. Source revision: 086ee9bfb37a879d7eff72db4916b5940b0cc616. The reference records implementation behavior; it does not certify hosted availability.
Source file fingerprints
docs/openapi/developer-runtime.openapi.json
SHA-256 c8342e49a76cf80bb57b382cebf7ee96955546fa0da2c7745fdf87bc056d90cf
docs/openapi/schemas/developer-runtime.schema.json
SHA-256 8528abb849a69826c9e38aa6caff73f6a1c1802fd797e984795dbef1c60863bd
cloudflare-worker/src/developers/data-plane-request.js
SHA-256 d052eb8312026d3e40753fefca7eac3492cd517017e7b603ccac65bd80b400f8
cloudflare-worker/src/developers/data-plane-stream.js
SHA-256 1b2005490f80e096b9531986bfd1d858e2c5a96c3cc0ca2aac5c8420792b7b8f