Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 1.18 KB

rest-api.md

File metadata and controls

69 lines (47 loc) · 1.18 KB

REST API Endpoints

Documentation on AI Warp's REST API.

For information on authentication, see here.

For information on rate limiting, see here

Endpoints

POST /api/v1/prompt

Prompt the AI Provider and receive the full response.

Body
{ "prompt": "What's 1+1?" }
Response
{ "response": "..." }

POST /api/v1/stream

Prompt the AI Provider and receive a streamed response. This endpoint supports Server Side Events.

Event types:

  • content - Response chunk
  • error - An error has occured and the stream is closed.
Body
{ "prompt": "What's 1+1?" }
Success response
event: content
data: {"response": "..."}

event: content
data: {"response": "..."}
Error response
event: error
data: {"code":"...","message":"..."}

When there is no more chunks to return or an error occurs, the stream is closed.