Caveman Cloud· HostedGet Started
Quickstart: Send Your First Request to Caveman Cloud
Go from zero to a live trace in Caveman Cloud: create an account, a project, and an API key, configure your client, send a request, and view it in Traces.
This guide takes you from creating an account to viewing your first trace in the Caveman Cloud console. You need an existing upstream model provider account (for example OpenAI) with an API key.
Create an account or sign in
Open your Caveman Cloud console in a browser. If you already have an account, sign in. Invited members land directly in the project they were invited to.
To create an account on hosted Caveman Cloud, choose Create an account and sign up with email and password, Google, or GitHub. Accept the Free notice, then confirm your email if you signed up with a password. At your first sign-in, Caveman Cloud creates a personal Free workspace that you own, with a project named Default. See Create an account.
Create a project
Use the Default project, or create a new project from the console and name it. The project is the scope for all traces, keys, and workloads you will inspect.
Create a Cave API key
Go to Gateway, Connect and generate a Cave API key. Copy the key value and the gateway URL. The gateway URL is the origin for your installation, with no trailing slash. For example:
https://gateway.caveman.so.Set environment variables
Export the key and gateway URL in your shell. Keep your upstream provider key available separately.
export CAVE_API_KEY="cave_live_..."
export CAVE_GATEWAY_URL="https://gateway.caveman.so"
export OPENAI_API_KEY="sk-..."Configure your client
Point your OpenAI client at the gateway with a base-URL swap. Send the upstream provider key in the
x-cave-upstream-keyheader when it is not stored in Caveman Cloud.import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.CAVE_API_KEY,
baseURL: `${process.env.CAVE_GATEWAY_URL}/openai/v1`,
defaultHeaders: {
"x-cave-upstream-key": process.env.OPENAI_API_KEY!,
"x-cave-agent": "support-agent",
"x-cave-workflow": "resolve-ticket",
},
});
const response = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello, Caveman" }],
});
console.log(response.choices[0].message.content);import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["CAVE_API_KEY"],
base_url=f"{os.environ['CAVE_GATEWAY_URL']}/openai/v1",
default_headers={
"x-cave-upstream-key": os.environ["OPENAI_API_KEY"],
"x-cave-agent": "support-agent",
"x-cave-workflow": "resolve-ticket",
},
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello, Caveman"}],
)
print(response.choices[0].message.content)curl "${CAVE_GATEWAY_URL}/openai/v1/chat/completions" \
-H "authorization: Bearer ${CAVE_API_KEY}" \
-H "x-cave-upstream-key: ${OPENAI_API_KEY}" \
-H "x-cave-agent: support-agent" \
-H "x-cave-workflow: resolve-ticket" \
-H "content-type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello, Caveman"}]}'The
x-cave-agentandx-cave-workflowheaders label traffic for reporting. They do not grant access.View the trace
Open Traces in the console and look for the request you just sent. You should see the model, tokens, latency, cost, and the agent and workflow labels you attached.
Next steps#
Learn how to route production agent or application traffic through the Gateway.
Filter, search, and understand request-level cost and latency.
Run read-only SELECT over your project's requests, spans, and tool events.
Build test cases and evaluate candidate changes against your traffic.