Skip to main content

Set up

Install the SDK, set the key, and find the first trace.

This page is the short path from an API key to the first trace. Quickstart and Installation have the details.

1. Get an API key

  1. Sign in at app.risicare.ai with GitHub or Google. Access is by invitation.
  2. The first person who signs in to a new organization gets a default project and an API key. The Your API key card on Home shows the key one time. Copy it.
  3. Everyone else: open Settings → API Keys and click Create API Key. Only an owner or an admin can create a key. Use the Ingest class for tracing and scores. The evaluation helper (evals.run, risicare eval gate) needs a Secret key, because an Ingest key cannot write evaluations.

A key belongs to one project. The spans that the key sends go to that project.

2. Install the SDK

LanguageNeedsInstall
PythonPython 3.10 or laterpip install risicare
JavaScript and TypeScriptNode.js 18 or laternpm install risicare

3. Set the key

Put the key in an environment variable. Do not write it in your code.

export RISICARE_API_KEY=rsk-...

Python. Call init() once, at the start of your process:

import risicare
 
risicare.init()  # reads RISICARE_API_KEY

Or set a second variable and only import the SDK. With RISICARE_TRACING=true, import risicare starts tracing with no init() call:

export RISICARE_TRACING=true
import risicare  # put this line before the imports of your LLM libraries

JavaScript. Call init(), and patch each provider client:

import { init } from 'risicare';
import { patchOpenAI } from 'risicare/openai';
import OpenAI from 'openai';
 
init({ apiKey: process.env.RISICARE_API_KEY });
const openai = patchOpenAI(new OpenAI());

With no key, the SDK sends nothing.

The SDK captures the text of prompts and completions by default. To keep that text in your process, set RISICARE_TRACE_CONTENT=false. See Configuration.

4. The endpoints

You do not need to set an endpoint. The SDK uses these hosts by default:

DataHostChange it with
Spanshttps://ingest.risicare.aiRISICARE_ENDPOINT
Scores, prompts, evaluationshttps://api.risicare.aiRISICARE_API_ENDPOINT

To send OpenTelemetry spans without the SDK, use OTLP over HTTP at https://ingest.risicare.ai/v1/traces, with the header Authorization: Bearer rsk-.... See OTLP Ingestion.

5. If you use OpenTelemetry already (Python)

The Python SDK has an OpenTelemetry bridge. It converts the spans of your OpenTelemetry instrumentation and sends them to Risicare. See OpenTelemetry. The JavaScript SDK has no bridge.

6. Providers and frameworks

The SDK traces the calls of these libraries.

7. Where the first trace appears

  1. Run your code. A short script must deliver its spans before it exits: call risicare.shutdown() at the end (JavaScript: await shutdown()).
  2. In the dashboard, open the project and click Traces. The list shows the Last 24 hours.
  3. The list does not update by itself. Click Refresh to load new traces.

On Home, the Get Started with Risicare card shows until the project receives its first trace.

If no trace appears, read what the SDK printed. A line that starts with Risicare: spans are NOT reaching names the cause. See Quickstart.

8. Add a second service

  1. Use a key of the same project in the second service. Its traces then go to the same project.
  2. Give each service its own name: init(service_name="billing") in Python, init({ serviceName: 'billing' }) in JavaScript, or RISICARE_SERVICE_NAME=billing.
  3. To make one trace of a request that goes from one service to the other, send the trace context with the request. The caller adds the traceparent header, and the receiver reads it. See Cross-service context propagation (Python) and Cross-process propagation (JavaScript).

Without step 3, each service sends its own traces.