Documentation

Connect your agent to ClientCoded

Two ways to connect, depending on what you're testing. Point your production conversations at the monitoring endpoint, or query a synthetic environment for data agent testing. No SDK required for either. The SDK is optional, for deeper tracing.

Quickstart

ClientCoded scores your agent's behavior. How you connect depends on the kind of agent you're testing.

Conversational agents (support bots, SDRs, assistants): after each conversation, your agent sends the transcript to the monitoring endpoint. We score it and show the results on your dashboard. This is the one-webhook, no-SDK setup.

Data agents (agents that query your data): your agent runs queries against a synthetic test environment through the Query API, and the answers are scored against computed ground truth.

Either path needs two credentials: an agent_id and your team api_key. See Credentials.

Production monitoring

After each conversation completes, POST the transcript to the monitoring endpoint. That single call is the entire setup: no SDK, no library, one HTTP request at the end of your conversation handler.

POSThttps://api.clientcoded.com/monitor

Request

Send JSON with your credentials and the full transcript. Each turn has a role ("user" or "agent") and a message.

Terminal
curl -X POST https://api.clientcoded.com/monitor \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "your-agent-id",
    "api_key": "your-team-api-key",
    "transcript": [
      { "role": "user",  "message": "I need help with my order" },
      { "role": "agent", "message": "Happy to help. What is your order number?" },
      { "role": "user",  "message": "It is #4521" },
      { "role": "agent", "message": "Order #4521 is currently being shipped." }
    ]
  }'

Response

We return an overall score out of 10, a flagged boolean for conversations that fall below your quality threshold, and a per-dimension breakdown.

JSON
{
  "score": 8.2,
  "flagged": false,
  "dimensions": {
    "accuracy": 9,
    "completeness": 8,
    "tone": 8
  }
}

Add this one call at the end of each conversation and every conversation is scored in real time, with Slack alerts when quality drops.

Optional SDK

Monitoring needs no SDK. If you want visibility into what happens inside your agent, the optional SDK automatically traces internal LLM calls, tool calls, and reasoning steps.

Python SDK
$ pip install clientcoded

import clientcoded
clientcoded.init(agent_id="your-agent-id", api_key="your-team-api-key")
# Automatically traces internal LLM calls and tool calls.

Query API

For data agent testing, your agent queries a synthetic environment instead of your production data. Each environment ships with a synthetic dataset and computed ground truth, so an answer can be graded against what is actually correct.

POSThttps://api.clientcoded.com/query

Request

Send the environment ID, the query your agent produced, and your team api_key.

Only SELECT queries are supported. Writes and schema changes (INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE) are rejected, and your api_key is validated against ownership of the environment.

Terminal
curl -X POST https://api.clientcoded.com/query \
  -H "Content-Type: application/json" \
  -d '{
    "environment_id": "your-environment-id",
    "sql": "SELECT COUNT(*) FROM accounts",
    "api_key": "your-team-api-key"
  }'

The endpoint returns the result set for your query. During a scored test run, your agent's answers are compared against the environment's computed ground truth and graded across the same dimensions.

Credentials

Both endpoints authenticate with two values from your dashboard:

  • agent_id is issued when you register an agent in the dashboard.
  • api_key is issued for your team at signup. You'll find it in your dashboard settings.

Keep your api_key server-side. Don't embed it in client-side code or commit it to a public repository.

Need help?

Wiring in your agent and want a hand, or want us to run a free audit against it first? Request an audit or talk to a founder.