From 4772716305027e10aa7c576484c3c821fde8be6c Mon Sep 17 00:00:00 2001 From: Arpit Gupta Date: Tue, 2 Jun 2026 02:38:30 +0530 Subject: [PATCH] docs(api-reference): remove legacy POST /api/chat streaming endpoint Drops the /api/chat path and ChatStreamRequest schema from the OpenAPI spec (keeps the shared ChatStreamErrorResponse), deletes the stream page and its nav entry, and repoints dead credits.mdx links to /api/chat/workflow. Co-Authored-By: Claude Opus 4.7 --- api-reference/chat/stream.mdx | 4 -- api-reference/openapi/research.json | 92 +---------------------------- credits.mdx | 4 +- docs.json | 1 - 4 files changed, 3 insertions(+), 98 deletions(-) delete mode 100644 api-reference/chat/stream.mdx diff --git a/api-reference/chat/stream.mdx b/api-reference/chat/stream.mdx deleted file mode 100644 index 79443683..00000000 --- a/api-reference/chat/stream.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Stream Chat -openapi: post /api/chat ---- diff --git a/api-reference/openapi/research.json b/api-reference/openapi/research.json index 92135d2f..f8c4d09c 100644 --- a/api-reference/openapi/research.json +++ b/api-reference/openapi/research.json @@ -689,50 +689,6 @@ } } }, - "/api/chat": { - "post": { - "description": "Stream AI-powered chat responses using the Recoup chat system. This endpoint mirrors the request payload of the Chat Generate API but returns a streaming response compatible with the Vercel AI SDK `createUIMessageStreamResponse`. The stream emits UI message parts encoded as data chunks that can be parsed with `createUIMessageStreamParser`.", - "security": [ - { - "apiKeyAuth": [] - } - ], - "requestBody": { - "description": "Chat stream request", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChatStreamRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Streaming response with UI message parts. Events include: message-start (assistant begins message), message-delta (incremental updates), message-end (assistant finishes message), error (stream error), and metadata (usage data).", - "content": { - "text/event-stream": { - "schema": { - "type": "string", - "description": "Server-Sent Events stream containing UI message parts" - } - } - } - }, - "400": { - "description": "Bad request - missing required parameters", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChatStreamErrorResponse" - } - } - } - } - } - } - }, "/api/chat/{chatId}/stop": { "post": { "description": "Stop the response currently being generated for a chat, freeing it to accept a new message. Idempotent — returns `stopped: false` when nothing is in progress. The chat must belong to the authenticated account.", @@ -800,7 +756,7 @@ "/api/chat/workflow": { "post": { "summary": "Stream sandbox-driven chat (Vercel Workflow)", - "description": "Streams an agent loop running as a durable [Vercel Workflow](https://vercel.com/docs/workflow) against the session's sandbox. The agent uses sandbox-only tools (`bash`, `read`, `write`, `grep`, `glob`, `todo`, `task`, `ask_user_question`, `skill`, `fetch`) — no MCP or Composio. Requires a sandbox provisioned via [POST /api/sandbox](/api-reference/sandbox/create). Parallel to [POST /api/chat](/api-reference/chat/stream) — does not replace it.", + "description": "Streams an agent loop running as a durable [Vercel Workflow](https://vercel.com/docs/workflow) against the session's sandbox. The agent uses sandbox-only tools (`bash`, `read`, `write`, `grep`, `glob`, `todo`, `task`, `ask_user_question`, `skill`, `fetch`) — no MCP or Composio. Requires a sandbox provisioned via [POST /api/sandbox](/api-reference/sandbox/create).", "security": [ { "apiKeyAuth": [] @@ -3296,52 +3252,6 @@ } } }, - "ChatStreamRequest": { - "type": "object", - "description": "Request body for chat streaming. Exactly one of 'prompt' or 'messages' must be provided.", - "properties": { - "prompt": { - "type": "string", - "description": "Single text prompt for the assistant. Required if 'messages' is not provided." - }, - "messages": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UIMessage" - }, - "description": "Array of UIMessage objects for context. Required if 'prompt' is not provided." - }, - "artistId": { - "type": "string", - "format": "uuid", - "description": "The unique identifier of the artist (optional)" - }, - "model": { - "type": "string", - "description": "The AI model to use for text generation (optional)", - "example": "openai/gpt-5-mini" - }, - "excludeTools": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Array of tool names to exclude from execution", - "example": [ - "create_scheduled_actions" - ] - }, - "roomId": { - "type": "string", - "format": "uuid", - "description": "UUID of the chat room. If not provided, one will be generated automatically." - }, - "topic": { - "type": "string", - "description": "Topic name for the new chat room (e.g., 'Pulse Feb 2'). Only applies when creating a new room - ignored if room already exists. To edit the topic of an existing room, use [PATCH /api/chats](/api-reference/chat/update)." - } - } - }, "ChatWorkflowRequest": { "type": "object", "description": "Request body for the sandbox-driven, Workflow-backed chat endpoint. Requires an existing session, chat, and provisioned sandbox. The Bearer key from the `Authorization` header is forwarded into the sandbox for skill-based callbacks to the Recoup API — no separate access-token field needed.", diff --git a/credits.mdx b/credits.mdx index 8954f245..3a1409e7 100644 --- a/credits.mdx +++ b/credits.mdx @@ -13,7 +13,7 @@ Some Recoup endpoints are billed in **credits** — primarily endpoints that hit |--------|---------|-------| | **Research** ([`/api/research/*`](/api-reference/research/search)) | Yes | Each successful call deducts credits. Costs vary by endpoint and parameters (e.g. [`enrich`](/api-reference/research/enrich) charges by processor tier; [`extract`](/api-reference/research/extract) charges by URL count). | | **Content generation** ([`/api/image/generate`](/api-reference/image/generation)) | Yes | Image generation is priced per call. | -| **AI Chat — streaming** ([`POST /api/chat`](/api-reference/chat/stream)) | Yes | Variable cost based on model token usage, with a per-request minimum. | +| **AI Chat — streaming** ([`POST /api/chat/workflow`](/api-reference/chat/workflow)) | Yes | Variable cost based on model token usage, with a per-request minimum. | | **Everything else** | Free at the API layer | [Artist CRUD](/api-reference/artists/list), [sandboxes](/api-reference/sandboxes/list), [sessions](/api-reference/sessions/get), [scheduled tasks](/api-reference/tasks/get), [social integrations](/api-reference/social/scrape), [account/org management](/api-reference/accounts/id), [agent signup](/api-reference/agents/signup), [Spotify proxies](/api-reference/spotify/search), etc. Subscription gating may still apply. | Failed calls (4xx / 5xx) do **not** deduct credits. Deduction happens only after the upstream call succeeds. @@ -175,7 +175,7 @@ Current as of this revision of the page. The authoritative source is the per-end | Endpoint | Cost | |----------|------| -| [`POST /api/chat`](/api-reference/chat/stream) (streaming) | ≥1 credit per turn — variable based on model token usage | +| [`POST /api/chat/workflow`](/api-reference/chat/workflow) (streaming) | ≥1 credit per turn — variable based on model token usage | | [`GET /api/research/*`](/api-reference/research/search) (artist & non-artist research) | 5 credits per call | | [`POST /api/research/people`](/api-reference/research/people) | 5 credits per call | | [`POST /api/research/web`](/api-reference/research/web) | 5 credits per call | diff --git a/docs.json b/docs.json index 43aa4750..d746b902 100644 --- a/docs.json +++ b/docs.json @@ -65,7 +65,6 @@ "pages": [ "api-reference/chat/workflow", "api-reference/chat/stop", - "api-reference/chat/stream", "api-reference/chat/generate" ] },