Quickstart

This quickstart creates an Agent through REST, then runs it through Rebyte's Responses-compatible endpoint.

You need curl, jq, Node.js, and pnpm.

1. Create an API key

Create an organization key in Settings → API Keys with tasks:read and tasks:write scopes. Copy the plaintext value when it is shown.

export REBYTE_API_KEY="rbk_replace_me"

2. Create an Agent

AGENT_JSON="$(
  curl -fsS https://api.rebyte.ai/v1/agents \
    -H "Authorization: Bearer $REBYTE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Research assistant",
      "instructions": "Answer clearly and cite the evidence you use.",
      "model": "deepseek-v4-pro"
    }'
)"

export REBYTE_AGENT_ID="$(printf '%s' "$AGENT_JSON" | jq -er '.agent.id')"
printf '%s\n' "$REBYTE_AGENT_ID"

The returned Agent UUID is the model value for every Response.

3. Run two turns

mkdir rebyte-quickstart
cd rebyte-quickstart
pnpm init
pnpm add openai

Create quickstart.mjs:

import OpenAI from "openai";

const rebyte = new OpenAI({
  apiKey: process.env.REBYTE_API_KEY,
  baseURL: "https://api.rebyte.ai/v1",
});

const first = await rebyte.responses.create({
  model: process.env.REBYTE_AGENT_ID,
  input: "What are the three most important facts about Rebyte?",
});

console.log(first.output_text);

const second = await rebyte.responses.create({
  model: process.env.REBYTE_AGENT_ID,
  conversation: first.conversation.id,
  input: "Turn that into one sentence.",
});

console.log(second.output_text);
console.log("Conversation:", second.conversation.id);
node quickstart.mjs

Both Responses belong to the same Conversation. Reuse its stable conversation.id for later turns.

4. Stream output

const stream = await rebyte.responses.create({
  model: process.env.REBYTE_AGENT_ID,
  input: "Research Rebyte and write a short brief.",
  stream: true,
});

for await (const event of stream) {
  if (event.type === "response.output_text.delta") {
    process.stdout.write(event.delta);
  }
}

Next: understand the execution model, configure the Agent, or handle the complete stream.