DocsAPI

API reference

Use this reference to look up the full request surface: authentication, upstream selection, per-request headers, endpoints and error shapes.

Agent prompt

Help me check this project's condense integration against the API reference. Read https://condense.chat/docs/reference/. Find where this project calls condense, then compare its routes, headers, credentials and error handling with the reference. A 403 on a provider route can mean the condense key lacks the Proxy permission (https://condense.chat/docs/api/#permissions). If it doesn't call condense yet, follow https://condense.chat/docs/quickstart/ instead. List anything that doesn't match, with the file and line, and ask me before changing it. Never print a key.

Introduction

condense.chat sits between your app and your LLM provider. Point your SDK at a provider route, add your condense key and keep your provider key. condense compacts the repeated context in each request before forwarding it upstream, with the same request and response shapes.

Choose the surface for your app:

  • Provider routes are drop-in for the Anthropic and OpenAI SDKs. Point base_url at /anthropic or /openai/v1 and everything else stays the same.
  • Cloud routes take your existing Vertex AI and Amazon Bedrock calls. Swap the host, keep the rest of the path, and the call still runs on your own cloud account.
  • /v1/compress compacts a transcript directly and hands it back, with no upstream call. Pick a model per request.
  • Pass-through forwards any other provider path (a models list, embeddings) verbatim.

Base URL: https://api.condense.chat. The dialect is selected by the path prefix; the X-Condense-Upstream-Url header selects where the compacted request is forwarded. This host runs in the EU; the US endpoint covers the second host, https://api.us.condense.chat. New here? Start with the Quickstart, choose a model on Models, and review Rate limits before production.

Authentication

Two keys travel on every request: your condense key (gates access to condense.chat) and your upstream provider key (charged for the model call). We never store the upstream key, only a sha256 fingerprint in the usage ledger.

The condense API key (ck_api_…) always travels in the X-Condense-Auth-Token header, on every route. The upstream key goes in whatever header the provider expects: x-api-key for Anthropic, Authorization: Bearer for OpenAI, a Google credential for Vertex AI, and a Bedrock API key sent as a bearer token for Amazon Bedrock. Using a custom header for the condense key means Authorization is always available for the upstream, with no precedence conflicts in any SDK.

API access is enabled for organization accounts after an email or call with our team. See Get API access.

Anthropic

httpPOST /anthropic/v1/messages
X-Condense-Auth-Token: ck_api_<your-condense-key>
x-api-key: sk-ant-<your-anthropic-key>
anthropic-version: 2023-06-01
Content-Type: application/json

OpenAI

httpPOST /openai/v1/chat/completions
X-Condense-Auth-Token: ck_api_<your-condense-key>
Authorization: Bearer sk-<your-openai-key>
Content-Type: application/json

Vertex AI

httpPOST /vertex/v1/projects/<project>/locations/<location>/publishers/anthropic/models/<model>:rawPredict
X-Condense-Auth-Token: ck_api_<your-condense-key>
Authorization: Bearer <your-google-access-token>
Content-Type: application/json

Amazon Bedrock

httpPOST /bedrock/<region>/model/<model-id>/invoke
X-Condense-Auth-Token: ck_api_<your-condense-key>
Authorization: Bearer <your-bedrock-api-key>
Content-Type: application/json

Bring your own upstream

By default a provider route forwards to that provider's own API: /anthropic/… to api.anthropic.com, /openai/… to api.openai.com. Send X-Condense-Upstream-Url to forward to something else instead. It can be any endpoint that speaks the OpenAI or Anthropic request shape, such as a self-hosted gateway, a vLLM or router deployment, or another vendor's compatible API. condense compacts the conversation exactly as it always does, then forwards there.

Anthropic routesSend the host root (https://host/prefix). condense appends /v1/messages.
OpenAI routesSend the base including /v1 (https://host/v1), matching the SDK base_url convention. condense appends /chat/completions.
bashcurl https://api.condense.chat/openai/v1/chat/completions \
  -H "X-Condense-Auth-Token: ck_api_..." \
  -H "Authorization: Bearer sk-..." \
  -H "X-Condense-Upstream-Url: https://my-gateway.example.com/v1" \
  -d '{"model":"my-model","messages":[...]}'

The URL must be https with a public host. Private and loopback addresses are rejected. If the upstream takes a different credential than the provider would, put it in X-Condense-Upstream-Key and it is used in place of whatever arrived in Authorization / x-api-key.

Overriding the upstream must be enabled on your account. Calls without the entitlement return 403.

This header is the only way to point condense somewhere else. To compress a transcript without any upstream call at all, use POST /v1/compress.

US endpoint

https://api.us.condense.chat serves the same API from AWS in the United States (us-east-1). Change the host in your base URL to use it. You keep the same API key, there's no setting to turn on, and your usage shows up in the same helm dashboard. The default host, api.condense.chat, runs in the EU.

Anthropichttps://api.us.condense.chat/anthropic
OpenAIhttps://api.us.condense.chat/openai/v1
Direct compressionPOST https://api.us.condense.chat/v1/compress
Vertex AIhttps://api.us.condense.chat/vertex
Amazon Bedrockhttps://api.us.condense.chat/bedrock/{region}
bashcurl https://api.us.condense.chat/anthropic/v1/messages \
  -H "X-Condense-Auth-Token: $CONDENSE_KEY" \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-haiku-4-5-20251001","max_tokens":256,"messages":[{"role":"user","content":"hi"}]}'

Credentials go in the same headers as on the default host. Compression, pass-through, streaming, request headers and rate limits work the same way, and the same errors apply.

Routes under /v1 other than /v1/compress, such as GET /v1/me/requests/{request_id}, are served from api.condense.chat. The US host answers them with a 307 redirect, so call them on api.condense.chat directly.

The dense CLI uses the default host. If you want to run it through the US endpoint, get in touch.

What runs where

On the US endpoint, requests are received and processed in the US, conversation content is held in memory only and sent to our EU infrastructure for compression, and account and billing records are kept in the EU.

US (us-east-1)Receiving your request, holding conversation content in memory, handling it in the proxy, and forwarding it to your model provider.
EUThe compression models, API key and account checks, and account and billing records.

On this endpoint your content doesn't stay in the US: conversation content goes to the EU for compression. The endpoint also isn't independent of the EU deployment, because it relies on our EU infrastructure to check API keys and load account settings.

Your model provider has its own processing locations. The subprocessor list shows the location and transfer safeguard for each provider we use.

Per-request headers

HeaderEffect
X-Condense-Auth-TokenRequired. Your condense API key (ck_api_…). Used on every route.
X-Condense-Upstream-UrlForward to this base instead of the provider default. Must be https with a public host. See Bring your own upstream.
X-Condense-Upstream-KeyCredential for the upstream, overriding whatever arrived in Authorization / x-api-key. Useful when your own upstream takes a different key than the provider.
X-Condense-Session-IdOptional. Groups requests into a session so the dashboard can show per-session savings. A UUID, or any id of yours up to 128 characters (condense maps it to a stable UUID). The dense CLI sets this for you.
X-Condense-TenantOptional. Your customer, workspace or account the request is for. Spend, savings and requests break down by it in the dashboard and the analytics API (group_by=tenant). Up to 128 characters.
X-Condense-End-UserOptional. The person within that tenant. Falls back to the body's Anthropic metadata.user_id or OpenAI user. Dropped under zero data retention and removed with other identifiers after 7 days.
X-Condense-FeatureOptional. Which part of your product made the call, e.g. chat or summarise. Up to 64 characters.
X-Condense-EnvOptional. prod, staging, dev or your own name, up to 32 characters.
X-Condense-TagsOptional. Up to eight key=value pairs, comma separated, stored with the request. Dropped under zero data retention.
Authorization / x-api-keyYour upstream provider key (Anthropic uses x-api-key; OpenAI, Vertex AI and Amazon Bedrock use Authorization: Bearer). Forwarded verbatim; never stored.

Response headers

condense adds these headers to the response:

HeaderMeaning
X-Request-IdThe request's id.
X-Condense-ModeHow the request was handled: full, lite or passthrough.
X-Condense-Mode-ReasonSent when X-Condense-Mode was not full.
X-Condense-StrategyThe compressor used.
X-Condense-Added-MsThe milliseconds condense spent before calling your provider.

Tokens and dollars saved settle after the response. Read them with GET /v1/me/requests/{request_id} (or /v1/orgs/{org_id}/requests/{request_id} for an org), using a key with the Read permission.

Upstream response headers come back as-is, minus hop-by-hop headers and content-encoding (bodies are re-encoded in flight).

Worked examples

Use these short guides to try each provider and mode. Each one has a paragraph on what the mode does, the smallest possible curl that exercises it, and then the same call in Python (no SDK, just urllib) in a three-turn tool loop that computes (17 + 25) * 3. To use one, pick a tab, copy the snippet, replace the keys and run it.

proxy is the condense path: condense compresses your messages, forwards to the upstream, and returns the provider's normal completion. You pay for the upstream call. This is the default and what most callers want.

direct tabs are baselines. They don't touch condense at all, included so you can compare and see exactly which headers change.

Provider
Mode

Baseline: talk to Anthropic directly. The Anthropic dialect puts the upstream key in x-api-key (not Authorization) and requires the anthropic-version header. Tools are typed; the model's tool calls come back as tool_use blocks; tool results go back as tool_result blocks.

bashcurl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-haiku-4-5-20251001","max_tokens":256,"messages":[{"role":"user","content":"hi"}]}'
pythonimport json, os
from urllib.request import Request, urlopen

URL = "https://api.anthropic.com/v1/messages"
KEY = os.environ["ANTHROPIC_API_KEY"]

TOOLS = [
  {"name":"add","input_schema":{"type":"object","properties":{"a":{"type":"number"},"b":{"type":"number"}},"required":["a","b"]},
  {"name":"mul","input_schema":{"type":"object","properties":{"a":{"type":"number"},"b":{"type":"number"}},"required":["a","b"]},
  {"name":"final_answer","input_schema":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},
]

def tool(name, args):
  if name == "add": return str(args["a"] + args["b"])
  if name == "mul": return str(args["a"] * args["b"])
  return args["text"]

def post(messages):
  body = json.dumps({
    "model":"claude-haiku-4-5-20251001","max_tokens":1024,
    "messages":messages,"tools":TOOLS,
  }).encode()
  req = Request(URL, method="POST", data=body, headers={
    "x-api-key": KEY,
    "anthropic-version": "2023-06-01",
    "Content-Type": "application/json",
  })
  return json.loads(urlopen(req).read())

messages = [{"role":"user","content":"Compute (17 + 25) * 3 using add and mul, then call final_answer."}]
for _ in range(6):
  resp = post(messages)
  blocks = resp["content"]
  messages.append({"role":"assistant","content":blocks})
  calls = [b for b in blocks if b["type"] == "tool_use"]
  if not calls:
    print("".join(b.get("text", "") for b in blocks)); break
  results = []
  for b in calls:
    result = tool(b["name"], b["input"])
    print(f"{b['name']}({b['input']}) -> {result}")
    results.append({"type":"tool_result","tool_use_id":b["id"],"content":result})
    if b["name"] == "final_answer": raise SystemExit
  messages.append({"role":"user","content":results})

Endpoints

Each entry lists the method and path, what the route does and an example request. Requests use the base URL and the credentials described in Authentication.

Compress messages

POST/v1/compressdirect compression · no upstream call

Compress a transcript and get it back in the same shape: N messages in, N messages out, each compressed independently with its role and order preserved. No conversation tracking, no upstream model call. Requires the compress capability on your account; returns 403 otherwise.

Request body

modelstringRequired
The compressor to run, by public name, e.g. helene-1.1 or adeline-1. An unknown or undeployed name returns 400 with the list of currently selectable compressors.
messagesarrayRequired
The transcript, in OpenAI chat shape ({"role", "content"}). A message the compressor abstains on (empty, too short, or quality-gated) comes back with its original content unchanged.
compression_ratenumber
Optional, helene-1.1 only. Fraction of tokens to remove, between 0 and 1. Omit to let the model pick the rate. Out-of-range values return 400.
POST /v1/compress
import httpx

resp = httpx.post(
    "https://api.condense.chat/v1/compress",
    headers={"X-Condense-Auth-Token": "ck_api_..."},
    json={
        "model": "helene-1.1",
        "compression_rate": 0.6,
        "messages": [
            {"role": "system", "content": "You are a terse assistant."},
            {"role": "user", "content": "<a long transcript to compress>"},
        ],
    },
)
print(resp.json())
Response
json{
  "model": "helene-1.1",
  "messages": [
    {"role": "system", "content": "terse assistant."},
    {"role": "user", "content": "<surviving text, verbatim>"}
  ]
}

Anthropic Messages

POST/anthropic/v1/messagesAnthropic dialect · chain-tracking proxy

Identical request and response shape to api.anthropic.com/v1/messages. Streaming (stream: true) is preserved end-to-end; all anthropic-* headers (prompt caching, betas) forward through unchanged.

POST /anthropic/v1/messages
import httpx

resp = httpx.post(
    "https://api.condense.chat/anthropic/v1/messages",
    headers={"X-Condense-Auth-Token": "ck_api_...", "x-api-key": "sk-ant-...", "anthropic-version": "2023-06-01"},
    json={"model": "claude-haiku-4-5", "max_tokens": 256, "messages": [{"role": "user", "content": "hi"}]},
)
print(resp.json())
Response is Anthropic's, verbatim.

OpenAI Chat Completions

POST/openai/v1/chat/completionsOpenAI dialect · chain-tracking proxy

Identical request and response shape to api.openai.com/v1/chat/completions. Streaming is preserved; tool calls round-trip.

POST /openai/v1/chat/completions
import httpx

resp = httpx.post(
    "https://api.condense.chat/openai/v1/chat/completions",
    headers={"X-Condense-Auth-Token": "ck_api_...", "Authorization": "Bearer sk-..."},
    json={"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "hi"}]},
)
print(resp.json())
Response is OpenAI's, verbatim.

OpenAI Responses

POST/openai/v1/responsesOpenAI Responses dialect · Codex

Drop-in for the OpenAI Responses API (used by Codex). Same request and response shape as api.openai.com/v1/responses.

POST /openai/v1/responses
import httpx

resp = httpx.post(
    "https://api.condense.chat/openai/v1/responses",
    headers={"X-Condense-Auth-Token": "ck_api_...", "Authorization": "Bearer sk-..."},
    json={"model": "gpt-4o-mini", "input": "hi"},
)
print(resp.json())
Response is OpenAI's, verbatim.

Claude on Vertex AI

POST/vertex/…/publishers/anthropic/models/{model}:rawPredictVertex AI · Claude

Claude on Vertex AI, on your own Google Cloud project. Swap your Vertex host for https://api.condense.chat/vertex, keep the rest of the path, and add your condense key. condense compresses the earlier turns of long conversations and adds one short instruction after your system prompt. Short conversations aren't compressed, and responses come back in Vertex's format.

Path

/vertex/{version}/projects/{project}/locations/{location}/publishers/anthropic/models/{model}:{verb}

{version} is v1 or v1beta1. {location} picks the Google host condense forwards to: global goes to aiplatform.googleapis.com, us and eu go to aiplatform.{location}.rep.googleapis.com, and any other location goes to {location}-aiplatform.googleapis.com.

Credentials

Your condense key in X-Condense-Auth-Token and your Google access token in Authorization: Bearer.

Request body

Vertex's Anthropic body. The model comes from the path, so condense removes any model from the body. It sets anthropic_version to vertex-2023-10-16 if you leave it out.

Compressed

:rawPredict and :streamRawPredict on publishers/anthropic, under a project path as shown above.

Forwarded unchanged

Every other path and method under /vertex that isn't covered in Gemini on Vertex AI, including count-tokens and other publishers such as Mistral. These calls aren't compressed and don't show up in your usage.

Streaming

Call :streamRawPredict with "stream": true in the body. The SSE stream is relayed back to you.

Limits

The same rate limits and errors as the other routes. A version other than the two above returns 404.

bashcurl "https://api.condense.chat/vertex/v1/projects/$GOOGLE_PROJECT/locations/global/publishers/anthropic/models/claude-sonnet-4-6:rawPredict" \
  -H "X-Condense-Auth-Token: $CONDENSE_KEY" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"anthropic_version":"vertex-2023-10-16","max_tokens":256,"messages":[{"role":"user","content":"hi"}]}'
Response is in Vertex's format. Use a model enabled on your project.

Gemini on Vertex AI

POST/vertex/…/publishers/google/models/{model}:generateContentVertex AI · Gemini

Gemini on Vertex AI, on your own Google account. Swap your Vertex host for https://api.condense.chat/vertex, keep the rest of the path, and add your condense key. condense compresses the earlier turns of long conversations and adds one short instruction at the end of your systemInstruction, after your own text. Short conversations aren't compressed, and responses come back in Gemini's format.

Path

With a project: /vertex/{version}/projects/{project}/locations/{location}/publishers/google/models/{model}:{verb}. In express mode, without a project: /vertex/{version}/publishers/google/models/{model}:{verb}. {version} and {location} work as in Claude on Vertex AI.

Credentials

Your condense key in X-Condense-Auth-Token, plus your Google access token in Authorization: Bearer or an express mode key in x-goog-api-key or ?key=. A condense key in ?key= returns 400.

Compressed

:generateContent and :streamGenerateContent?alt=sse, in Gemini's native format.

Forwarded unchanged

:streamGenerateContent without alt=sse, :countTokens, cachedContents and Vertex's OpenAI-compatible endpoint. These calls aren't compressed and don't show up in your usage.

Explicit caches

A request that names a cache with cachedContent doesn't get the added instruction.

Streaming

Add alt=sse to :streamGenerateContent to get compression. The SSE stream is relayed back to you.

Limits

The same rate limits and errors as the other routes. This route is for Vertex AI only: calls to the Gemini Developer API at generativelanguage.googleapis.com aren't covered.

bashcurl "https://api.condense.chat/vertex/v1/projects/$GOOGLE_PROJECT/locations/global/publishers/google/models/gemini-3.8-flash:generateContent" \
  -H "X-Condense-Auth-Token: $CONDENSE_KEY" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"role":"user","parts":[{"text":"hi"}]}]}'
Response is in Gemini's format. Use a model enabled on your project.

Amazon Bedrock

POST/bedrock/{region}/model/{modelId}/invokeAmazon Bedrock

Amazon Bedrock, on your own AWS account. Swap https://bedrock-runtime.{region}.amazonaws.com for https://api.condense.chat/bedrock/{region}, keep the rest of the path, and add your condense key. condense compresses the earlier turns of long conversations and adds one short instruction after your system prompt. Short conversations aren't compressed, and responses come back in your provider's format.

{region} is an AWS region and picks the host condense forwards to. This route always targets bedrock-runtime, so Bedrock Mantle isn't on it.

Credentials

Your condense key in X-Condense-Auth-Token and a Bedrock API key in Authorization: Bearer. On a compressed path, a request with no bearer token returns 401, and x-api-key doesn't count as one. SigV4 isn't supported, because a signature covers the host and the body, and condense changes them.

Compressed

  • model/{modelId}/invoke and model/{modelId}/invoke-with-response-stream, when the model ID contains anthropic.. That covers inference profile IDs too.
  • anthropic/v1/messages
  • openai/v1/chat/completions
  • openai/v1/responses. previous_response_id isn't forwarded and store is set to false, so send the whole conversation on each request.

Request body

On InvokeModel, send Bedrock's Claude body. condense removes any model and stream fields, sets anthropic_version to bedrock-2023-05-31 if you leave it out, and moves an anthropic-beta header into the body as anthropic_beta.

Forwarded unchanged

Everything else under /bedrock/{region}, including Converse, ConverseStream and InvokeModel on non-Claude models. These calls aren't compressed and don't show up in your usage.

Streaming

invoke-with-response-stream returns application/vnd.amazon.eventstream. To get Anthropic SSE instead, send Accept: text/event-stream without also accepting the eventstream type. The Messages, Chat Completions and Responses paths stream with "stream": true. On Chat Completions, condense adds stream_options.include_usage unless you set stream_options yourself.

Limits

The same rate limits and errors as the other routes. A region that isn't in AWS's format returns 404.

bashcurl "https://api.condense.chat/bedrock/eu-west-1/model/eu.anthropic.claude-opus-4-6-v1/invoke" \
  -H "X-Condense-Auth-Token: $CONDENSE_KEY" \
  -H "Authorization: Bearer $AWS_BEARER_TOKEN_BEDROCK" \
  -H "Content-Type: application/json" \
  -d '{"anthropic_version":"bedrock-2023-05-31","max_tokens":256,"messages":[{"role":"user","content":"hi"}]}'
Response is in Bedrock's format. Use a model enabled on your account, in its region.

Pass-through

GET/{provider}/…pass-through · forwarded verbatim

Any other path under a provider prefix (a models list, embeddings, and so on) is forwarded to the upstream unchanged. The compression pipeline does not touch it; this is purely an SDK-compat convenience so one base URL covers the whole provider surface.

GET /{provider}/…
import httpx

resp = httpx.get(
    "https://api.condense.chat/openai/v1/models",
    headers={"X-Condense-Auth-Token": "ck_api_...", "Authorization": "Bearer sk-..."},
)
print(resp.json())
Response is the provider's, verbatim.

Debugging requests

Failures come back as standard HTTP status codes with the dialect's normal error body; the full breakdown is in Errors below. Two things help when something goes wrong:

  • Rate limits. A 429 carries a Retry-After header. Retry after that delay with backoff. See Rate limits.
  • Request id. Every response carries X-Request-Id (send your own and we keep it). If a request misbehaves, quote that id and reach us via contact. We can correlate it on our side.

Compression never breaks a call on its own: if the condense pipeline hits an internal error mid-request, the proxy forwards your original body upstream unchanged and the request completes without compression.

Backwards compatibility

condense avoids breaking changes. The request and response shapes are the provider's own (Anthropic, OpenAI, Vertex AI, Amazon Bedrock), so upgrading condense never changes the wire format your SDK expects. Model ids are stable aliases: helene-1.1 and adeline-1 keep pointing at the current best engine while internal versions move underneath.

Changes we make freely, without notice:

  • adding new routes, optional request fields, and response fields;
  • adding new models behind new aliases;
  • changing the format of opaque identifiers (keys, request ids).

Retirements are announced ahead of time on Deprecations, and notable changes land in the Changelog.

Errors

Errors follow standard HTTP status codes. Bodies are the dialect's native error JSON for upstream-origin failures (so SDK error parsers keep working); condense-origin failures use a small {"error": {"type": "...", "message": "..."}} shape.

StatusMeaning
400Bad request body, a malformed Authorization header, or an unknown model / out-of-range compression_rate on /v1/compress.
401Missing or invalid condense key, or no bearer token on a compressed Amazon Bedrock path.
402A spend limit on your organization, a person or a key is used up (error type budget_exceeded), or your credit balance has run out on a /v1/compress call.
403Your key is valid but the account isn't entitled to what the request asked for: compress, the proxy itself, or an upstream URL override. Also returned when the key lacks the permission for the route (Proxy, Models from condense, Read or Manage), when your admin has paused personal keys, and on a compressed /vertex path when the request has no Google credential.
404A path that isn't a valid /vertex or /bedrock path, such as an unknown Vertex version or a malformed AWS region.
413The request body is over the size limit. The response body states the limit.
429Rate-limited. The Retry-After response header says how many seconds to wait.
5xxUpstream provider error. The upstream status and body are forwarded verbatim.

Compression itself never breaks a conversation: if the condense pipeline hits an internal error mid-request, the proxy forwards your original body upstream unchanged and the call completes without compression.

Management API

The management API reads and changes what you see in the dashboard: usage, request logs, keys, members and limits. Its routes live under https://api.condense.chat/v1/. List your organizations with GET /v1/orgs; organization routes take its org_id. The tables below show organization routes after /v1/orgs/{org_id}, so /keys means /v1/orgs/{org_id}/keys.

Send a key in X-Condense-Auth-Token. It needs the Read permission for GET requests and Manage for everything else. A company key acts with the access of the person who created it, and a personal key with yours. A missing permission or access level returns 403.

Who can call what

Admins can call every route. Everyone else needs the access level below.

AccessRoutes
View on APIGET /keys
Manage on APIPOST /keys, and PATCH, /roll and DELETE on a key. Members who aren't admins can change only the keys they created.
View on TeamsGET /members, GET /usage, /analytics/sessions
View on Teams and API/requests/{request_id}, /usage/by-model, /savings/daily
View on Teams or APIGET /overview, GET /budgets
View, by traffic/requests, /requests/export, the other /analytics/… routes, /usage/series, /budgets/overview. You need View on each product the traffic filter covers. Grouping by member or group also needs View on Teams, and /usage/series and /analytics/export group by member unless you pass another group_by.
Manage, by limitPOST /budgets, and PUT and DELETE on a limit. You need Manage on the side the limit covers: Teams for people, API for keys, both for a company limit.
AdminInvites, member access, roles, seats, raise requests, billing, credits, settings, webhooks and the audit log.

Paths in this table are relative to /v1/orgs/{org_id}.

People and API traffic

Request logs, analytics, /usage/series and /budgets/overview take a traffic filter.

  • traffic=people: everything not sent with a company key. That is your staff's coding agents, the dense CLI and personal keys. Needs View on Teams.
  • traffic=api: only requests sent with company keys. Needs View on API.
  • Leave it out to cover both. Needs View on both.

Keys

RouteWhat it does
GET /keysLists company keys with their permissions, limit, expiry, created_by_user_id and 30-day usage.
POST /keysCreates a company key. Returns id, prefix and secret. The secret is shown once.
PATCH /keys/{key_id}Changes name, proxy, models, access or rpm_limit. Send only the fields you change.
POST /keys/{key_id}/rollReturns a new secret. The old one keeps working for 24 hours. A key can be rolled once: a second roll returns 409.
DELETE /keys/{key_id}Revokes the key at once.
POST /v1/tokensCreates a personal key. Same body; the response also has expires_at.

Request body

namestring
Optional. A label you'll recognise.
expires_in_daysinteger
Optional, 1 to 365, default 60. Only on create: roll the key to get a new expiry.
proxyboolean
The Proxy permission. Default true.
modelsboolean
The Models from condense permission. Default false. If your organization doesn't resell condense's models, true returns 400.
accessstring
Management API access: none, read or manage. Default none.
rpm_limitinteger
Optional requests per minute, 1 to 100000. On PATCH, null removes the limit.

A key needs at least one permission. A body with proxy and models false and access set to none returns 400. To create a key that can proxy and read usage, call with a key that has Manage:

bashcurl https://api.condense.chat/v1/orgs/$ORG_ID/keys \
  -H "X-Condense-Auth-Token: $CONDENSE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"support-agent","proxy":true,"access":"read","rpm_limit":600}'

Members and invites

RouteWhat it does
GET /membersLists members with role, teams_access, api_access, personal_keys, seat_tier and seat_ends_at, which is set while a removed seat runs to the end of its period.
PATCH /members/{user_id}/accessSets teams_access and api_access (none, view or manage) and personal_keys (boolean). Leave a field out to keep it. Returns the member. An admin returns 409: admins always have full access.
POST /members/inviteInvites by email, with an optional role, seat_tier, teams_access, api_access and personal_keys. The person gets that access when they accept. An organization billed by credits can't send seat_tier.

Next steps

  • Rate limits: review request and credit limits before production.
  • Models: choose a compaction model.
  • Changelog: read notable changes to the routes.