Rend API

Endpoints

Chat completions

The OpenAI chat completions format, with Rend’s two text models, with no editorial filter. Your messages go to the model exactly as you send them: Rend adds no system prompt of its own. Every call needs the account’s one-time 18+ terms.

POSThttps://rend.ai/api/v1/chat/completions

POSThttps://rend.ai/api/v1/chat/compact

GEThttps://rend.ai/api/v1/models

Request body

POSThttps://rend.ai/api/v1/chat/completions

Rend-only fields such as search, x_posts and prompt_cache_key go in extra_body with the Python SDK. The JavaScript SDK passes them through as written.

Field Type Description
model string required rend-pro (Opus 5.5 level) or rend-swift (Opus 4.8 level). See Models & pricing.
messages array required The conversation, up to 2,000 messages. Roles: system, developer, user, assistant, tool. Content is text, or text and image_url parts (https or base64 data), up to 10 pictures a request.
stream boolean Send the reply as it is written. See Streaming.
search string "off" (the default), "web" (web search only) or "auto" (web search, and X search when x_posts is set). The model decides when to search.
x_posts integer How many X posts this request may read across its searches, 10 to 500. Sending it turns search on as "auto". 0 turns X off. Each post read is 0.5¢.
prompt_cache_key string Up to 256 characters. Requests with the same key share a warm cache. See Prompt caching.
reasoning_effort string How long the model thinks. rend-swift: none, low, high (default) or max. rend-pro: low, high (default) or max. OpenAI’s minimal, medium and xhigh are accepted and mapped to the nearest level.
include_reasoning boolean Return the model’s thinking as reasoning_content. Its tokens are billed and counted either way.
max_tokens / max_completion_tokens integer Cap on output, thinking included. Up to 131,072 for Rend Swift and 128,000 for Rend Pro. With a short cap, send "reasoning_effort": "none" or the reply can come back empty.
tools array Up to 128 function tools, in the OpenAI shape. The names web_search, x_search and google_trends are reserved.
tool_choice string or object auto, none, required or {"type": "function", "function": {"name": "..."}}.
parallel_tool_calls boolean Allow several tool calls in one turn.
response_format object {"type": "json_object"} or {"type": "json_schema", "json_schema": {...}}.
temperature, top_p, top_k, min_p number Sampling. While the model thinks, temperature has no effect.
frequency_penalty, presence_penalty, repetition_penalty number Repetition controls.
seed integer A positive integer for more repeatable output.
stop string or array Up to 4 stop strings. A stop string also cuts the thinking, so pair it with "reasoning_effort": "none".

n must be 1. logprobs and logit_bias are not supported. Any other field is ignored.

Example
POST/v1/chat/completions
curl https://api.rend.ai/v1/chat/completions \
-H "Authorization: Bearer $REND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "model": "rend-pro",
  "messages": [
    {"role": "system", "content": "You are a sharp direct-response copywriter."},
    {"role": "user", "content": "What are people saying about cold plunges this week? Then write two hooks."}
  ],
  "search": "auto",
  "reasoning_effort": "low"
}'

Response

  • model is the model that ran.
  • finish_reason is stop, length, tool_calls or content_filter.
  • usage.cost is what the request cost, in dollars. cost_details splits it into input, cached input, output and search. The parts can differ from the total by rounding.
  • search_results lists every web page and X post the model searched, each with its url.
  • The x-request-id header carries the request’s id. Include it when you contact support.
ResponseJSON
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1796500000,
  "model": "rend-pro",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "...",
      "tool_calls": []
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 1840,
    "completion_tokens": 512,
    "total_tokens": 2352,
    "prompt_tokens_details": { "cached_tokens": 1536 },
    "completion_tokens_details": { "reasoning_tokens": 200 },
    "cost": 0.011053,
    "cost_details": {
      "input": 0.000912,
      "cached_input": 0.000461,
      "output": 0.00768,
      "search": 0.002
    },
    "searches": { "web_search": 2, "x_search": 0 }
  },
  "search_results": [
    {
      "type": "web",
      "query": "cold plunge trend",
      "url": "https://..."
    }
  ]
}

Tools

Tools work as in the OpenAI format. The model returns tool_calls; you run them and send the results back as tool messages with the matching tool_call_id.

tools = [{
  "type": "function",
  "function": {
      "name": "get_order",
      "description": "Look up an order by its number.",
      "parameters": {"type": "object", "properties": {"number": {"type": "string"}}, "required": ["number"]},
  },
}]
reply = client.chat.completions.create(model="rend-swift", messages=messages, tools=tools)
call = reply.choices[0].message.tool_calls[0]
messages += [reply.choices[0].message, {"role": "tool", "tool_call_id": call.id, "content": '{"status": "shipped"}'}]
final = client.chat.completions.create(model="rend-swift", messages=messages, tools=tools)

Search is off unless you ask for it, so a request costs only its tokens. With "search": "web" or "auto" the model gets search tools and decides itself when to use them; Rend runs the searches and feeds the results back, all inside the one request. You pay for each search at cost, and usage.searches counts them.

X search reads posts from the last 7 days and is billed per post read, so it runs only when you send x_posts, which is the most posts the request may read.

Compact a long conversation

POSThttps://rend.ai/api/v1/chat/compact

Shortens a conversation so you can keep going without resending all of it. Send model, messages, your tools and optionally search, x_posts, prompt_cache_key and keep_tokens. You get messages back: the older part condensed into a summary and the newest part word for word, about 139,000 tokens of it unless you set keep_tokens. Send those messages from then on.

Compaction is billed like a request. A conversation that is already short enough returns a 400.

ResponseJSON
{
  "id": "cmpct-...",
  "object": "chat.compaction",
  "created": 1796500000,
  "model": "rend-swift",
  "messages": [ ... ],
  "compacted": {
    "messages": 48,
    "tokens_before": 212000,
    "tokens_after": 3100
  },
  "usage": { ... }
}

List models

GEThttps://rend.ai/api/v1/models

Lists every model with your account’s live prices. See Models & pricing.