Respos·ai← Back to journal
§ Docs · JSON API

The JSON API.

Use your agent from any code that can make an HTTP POST request. No SDK required.

The endpoint

POST https://resposai.com/api/chat/{token}

Your token is shown on the Deploy tab. Every agent has a unique token.

Maintaining conversation history

The API returns a conversation_id on the first turn. Pass it back on subsequent requests and the agent will have full memory of the conversation.

// Turn 1
const r1 = await fetch('/api/chat/TOKEN', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ question: 'Hello' }),
})
const { reply, conversation_id } = await r1.json()

// Turn 2 — pass the id back
const r2 = await fetch('/api/chat/TOKEN', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ question: 'Tell me more', conversation_id }),
})
const { reply: reply2 } = await r2.json()

CORS

Cross-origin requests are allowed. If you have configured allowed domains on your agent, only requests from those origins will succeed — others get HTTP 403.

Full reference

See the API reference for all fields, error codes, and rate limits.