Coolhand LLM Request Logging API (v2)

LLM Request Logging API Documentation.

Introduction

This API allows clients to log and store request/response data from Large Language Model (LLM) API calls for monitoring, analysis, and debugging purposes. The API accepts any JSON structure in the raw_request field, making it flexible for different LLM providers and use cases.

Authentication

API uses API Key authentication. Clients are issued unique API keys that must be included in requests using one of these methods:

  • X-API-Key header: X-API-Key: your_api_key_here
  • Authorization Bearer header: Authorization: Bearer your_api_key_here

Contact your administrator to obtain an API key.

Public vs. private keys

Every client is issued two independent keys:

  • Public key (ch_pub_...) — safe to embed in SDK setup snippets, agent-facing code, or anywhere else it might be exposed to an end user. It only permits ingest-style writes (e.g. logging a new request, submitting feedback) — it cannot read back any data.
  • Private key (ch_priv_...) — required for read endpoints and other sensitive operations (e.g. optimization evidence links). Never embed a private key in client-side or agent-facing code; treat it like a server-side secret.

Each endpoint below documents which key type(s) it accepts. Endpoints that require a private key are marked accordingly.

Common Use Cases

OpenAI API Logging

Log requests and responses from OpenAI's chat completions, embeddings, and other endpoints.

Anthropic Claude Logging

Store conversation data and model responses from Claude API calls.

Custom LLM Provider Logging

The flexible JSON structure supports any LLM provider's request/response format.

Analytics and Monitoring

Aggregate usage statistics, token consumption, and performance metrics across LLM calls.

API Error Handling

Error Response Structure

When interacting with the LLM Request Logging API, you'll encounter standard error response formats for different types of failures.

HTTP Status Codes

Understanding the HTTP status codes for this API:

HTTP Status CodeDescription
201 CreatedLLM request log successfully created
400 Bad RequestMalformed request or invalid JSON structure
401 UnauthorizedMissing, invalid, or expired API key
422 Unprocessable EntityValidation error - required fields missing or invalid format
5xx Server ErrorsServer-side issues - please report these for investigation
Servers
API server
http://{productionHost}
Local server
http://{defaultHost}