Partner API reference

Build with rybot.

Provision a scoped session, create a thread, send work, and stream the result. API credentials are issued through a managed ryco.io partner setup.

HTTP APIv2
Base URL
https://api.ryco.io
Authentication
Managed service + session tokens
Reference
29 public endpoints
01

Integration model

rybot is designed to sit behind your product's authenticated experience. Your server identifies the user, creates a short-lived rybot session, and gives only that session token to the client.

Server-owned identity

Your service maps its users and organizations into scoped rybot sessions.

Streaming by default

Long-running work reports progress and results through an event stream.

Managed credentials

ryco.io provisions service access after the integration scope is approved.

02

Authentication

Keep the partner service token on your server. Exchange it for a user-scoped session token, then send that session token as a Bearer credential on user-facing API requests.

1

Your serverHolds the managed service credential

2

rybot sessionScopes access to one external user

3

Your clientUses only the short-lived session token

There is no public key generator. Request access to receive credentials and environment details from ryco.io.

03

Quickstart

Create a sessionserver-side
curl -X POST https://api.ryco.io/v2/sessions \
  -H "Content-Type: application/json" \
  -H "x-rybot-service-token: $RYBOT_SERVICE_TOKEN" \
  -d '{
    "externalUserId": "user_123",
    "externalOrgId": "school_456",
    "gradeLevel": "6",
    "subjectArea": "Science"
  }'
Send a messagesession-scoped
curl -X POST https://api.ryco.io/v2/threads/:threadId/messages \
  -H "Authorization: Bearer $RYBOT_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Compare the three uploaded readings and explain the key differences.",
    "web": "auto"
  }'

The message response includes a run ID. Subscribe to/v2/runs/:runId/events to receive progress, text, citations, generated images, files, completion, and error events.

04

Public capabilities

rybot's public API covers the full conversation lifecycle—from grounded research and generated media to delivery, voice, and useful context between sessions.

06
Image generation

Create the visual in the conversation.

Generate original illustrations, diagrams, classroom visuals, and coordinated image sets through the same message API used for every rybot conversation.

POST/v2/threads/:threadId/messages

Describe the image in content and set theimagefield to control how rybot handles the request.

auto

Let rybot infer when a prompt calls for an original image.

required

Require image generation for this message.

off

Keep image generation unavailable for this message.

Generate an imagesession token
curl -X POST https://api.ryco.io/v2/threads/:threadId/messages \
  -H "Authorization: Bearer $RYBOT_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Create a labeled watercolor diagram of the water cycle for grade 5.",
    "image": "required"
  }'
Stream the result

Images arrive as run events.

The message response returns a runId. Subscribe to/v2/runs/:runId/events and listen for two image event types.

image_generation
Reports started, completed, or failed status.
generated_image
Returns the stored image metadata and access path.
Server-sent eventstext/event-stream
event: image_generation
data: {"type":"image_generation","status":"started","index":0,"total":2,"label":"Water cycle"}

event: generated_image
data: {"type":"generated_image","mediaId":"media_123","accessPath":"/v2/media/media_123","mimeType":"image/png","index":0,"total":2}

Ask for multiple visuals in one prompt to receive a coordinated set. Each image event includes index, total, and an optional label so your interface can place results as they finish.

07
PDF generation

Turn the request into a finished document.

Create polished PDFs from a prompt and optional attachments. rybot can research the subject, create supporting visuals, render the document, and validate the file before delivery.

POST/v2/threads/:threadId/messages

Ask explicitly for a PDF in content. Setwebto required when the document needs current, sourced research.

01preparing

Plan the document and gather any required research.

02creating_visuals

Create illustrations requested by the document plan.

03rendering

Assemble the content and visual system into a PDF.

04validating

Verify the generated file before returning it.

Create a researched PDFsession token
curl -X POST https://api.ryco.io/v2/threads/:threadId/messages \
  -H "Authorization: Bearer $RYBOT_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Create a four-page PDF guide to the water cycle for grade 5 with diagrams and a sources page.",
    "web": "required"
  }'
Stream the document

Show progress before the file arrives.

PDF lifecycle events expose the active phase. The generated file event returns an attachment with its filename, media type, and access path.

pdf_generation
Reports started, completed, or failed status across 4 phases.
generated_file
Returns the completed PDF as a message attachment.
Server-sent eventstext/event-stream
event: pdf_generation
data: {"type":"pdf_generation","status":"started","phase":"preparing","fileName":"water-cycle-guide.pdf"}

event: generated_file
data: {"type":"generated_file","attachment":{"fileName":"water-cycle-guide.pdf","mimeType":"application/pdf","accessPath":"/v2/media/media_456"}}

event: pdf_generation
data: {"type":"pdf_generation","status":"completed","phase":"validating"}

Generated PDFs are stored as private media. Use the media endpoint to download them, create a revocable public share when needed, or continue in the same thread to request a revision.

API reference

HTTP endpoints

Explore every supported public endpoint for sessions, messages, streaming runs, generated media, file sharing, voice, realtime, memory, and suggestions.

Sessions

1
POST/v2/sessions

Exchange a managed service credential for a scoped user session.

service token

Threads & messages

7
GET/v2/threads

List the authenticated user's conversation threads.

session token
POST/v2/threads

Create a conversation thread.

session token
PATCH/v2/threads/:threadId

Update a thread title or lifecycle status.

session token
DELETE/v2/threads/:threadId

Delete a conversation thread.

session token
GET/v2/threads/:threadId/messages

Page through messages in a thread.

session token
POST/v2/threads/:threadId/messages

Send a message and start an asynchronous rybot run.

session token
POST/v2/thread-title

Create a concise title for conversation content.

session token

Runs & streaming

4
GET/v2/runs/:runId/events

Stream run progress and results as server-sent events.

session token
GET/v2/runs/:runId

Read the current state of a run.

session token
POST/v2/runs/:runId/cancel

Cancel an active run.

session token
POST/v2/runs/:runId/retry

Retry a failed run without duplicating its user message.

session token

Files & sharing

4
POST/v2/uploads

Upload source material for analysis within a session.

session token
GET/v2/media/:mediaId

Download private media owned by the authenticated user.

session token
POST/v2/media/:mediaId/share

Create a revocable public share for a media file.

session token
DELETE/v2/media/:mediaId/share

Revoke a media file's public share.

session token

Voice & realtime

5
POST/v2/audio/speech

Create speech audio for supported response text.

session token
POST/v2/audio/speech/stream

Stream speech audio as it is produced.

session token
POST/v2/realtime/sessions

Create a short-lived realtime voice session.

session token
POST/v2/realtime/turns

Persist completed realtime conversation turns.

session token
POST/v2/realtime/sessions/:sessionId/end

Finish a realtime session and its server-side work.

session token

Personalization

5
POST/v2/suggestions

Return contextual ways to continue a conversation.

session token
POST/v2/suggestions/feedback

Record feedback on a contextual suggestion.

session token
GET/v2/memories

List the authenticated user's saved context.

session token
PATCH/v2/memories/:memoryId

Update or hide a saved memory.

session token
DELETE/v2/memories/:memoryId

Delete a saved memory.

session token

Shared media

2
GET/share/:token/metadata

Read metadata for a valid public share.

public
GET/share/:token

Download the file behind a valid public share.

public

System

1
GET/health

Check API availability and deployed version.

public
Need credentials?

Plan your rybot integration with ryco.io.

Request API access