Skip to content

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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-..."
  5. 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-key header 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);

    The x-cave-agent and x-cave-workflow headers label traffic for reporting. They do not grant access.

  6. 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#

Connect a Workload

Learn how to route production agent or application traffic through the Gateway.

Traces and Spend

Filter, search, and understand request-level cost and latency.

Query with SQL

Run read-only SELECT over your project's requests, spans, and tool events.

Evaluations

Build test cases and evaluate candidate changes against your traffic.

Esc

Start here