Download OpenAPI specification:
LLM Request Logging API Documentation.
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.
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: your_api_key_hereAuthorization: Bearer your_api_key_hereContact your administrator to obtain an API key.
Every client is issued two independent keys:
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.ch_priv_...) — required for read endpoints and other sensitive operations
(e.g. change suggestions, 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.
Log requests and responses from OpenAI's chat completions, embeddings, and other endpoints.
The flexible JSON structure supports any LLM provider's request/response format.
Aggregate usage statistics, token consumption, and performance metrics across LLM calls.
When interacting with the LLM Request Logging API, you'll encounter standard error response formats for different types of failures.
object Contains error details. |
{- "errors": {
- "__field_name__": [
- "Password should be at least 6 chars long",
- "Password should contain at least one number"
]
}
}Understanding the HTTP status codes for this API:
| HTTP Status Code | Description |
|---|---|
201 Created |
LLM request log successfully created |
400 Bad Request |
Malformed request or invalid JSON structure |
401 Unauthorized |
Missing, invalid, or expired API key |
422 Unprocessable Entity |
Validation error - required fields missing or invalid format |
5xx Server Errors |
Server-side issues - please report these for investigation |
API endpoints for logging and storing LLM (Large Language Model) request/response data
Creates a new LLM request log entry for monitoring and analysis purposes. See the Understanding an LLM Request Log guide for a full description of the fields Coolhand captures, which fields each provider exposes, and common gotchas. id is the log's hashid (a string), not the internal integer primary key — every log identifier returned by this API is a hashid, matching the GET endpoints below; consumers that previously parsed id as an integer need to treat it as an opaque string instead.
| X-API-Key | string API key for authentication |
| Authorization | string Bearer token with API key |
required | object |
{- "llm_request_log": {
- "raw_request": { },
- "collector": "string",
- "metadata": { }
}
}{- "id": "string",
- "collector": "string",
- "source_api": "string",
- "metadata": { },
- "source_api_result": "string",
- "model": "string",
- "template_id": "string",
- "template_name": "string",
- "input_tokens": 0,
- "output_tokens": 0,
- "latency_ms": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "warnings": [
- "string"
]
}Returns this client's LLM request logs as a bare JSON array (unlike GET /api/v2/llm_request_log_feedbacks's { feedback:, pagination: } envelope - coolhand-cli's fetchLastSync relies on this response being Array.isArray, so the body shape is intentionally not wrapped). Pagination totals are exposed via X-Page/X-Per-Page response headers, plus X-Total-Count/X-Total-Pages when include_total=true is passed (omitted by default to skip the COUNT(*) query - analyze-claude-sessions's frequent per=1 dedup-cutoff poll never needs a total). Supports Ransack search via q[...] params (e.g. q[source_api_in][]=claude_code), sorting via q[s] (e.g. created_at desc for newest first; when no q[s] is supplied, the endpoint applies a stable default sort of id desc for newest first so pagination is deterministic - pass q[s] explicitly to override), and pagination via page/per (per_page also accepted; default 25, max 100). Requires the private API key - the public key is write-only and cannot read. id is always the log's hashid (not the internal integer PK) - the sort itself still orders by the real primary key internally, but a cutoff/cursor derived from results should key off created_at, not id, since hashids don't sort lexically in creation order. analyze-claude-sessions uses this to derive its dedup cutoff by requesting the newest claude_code/claude_cowork record (per=1), instead of a bespoke endpoint. Also supports named filters (applied on top of any q[...] filtering, not in place of it): template_id/workload_id (hashid), system_prompt_contains/user_prompt_contains (case-insensitive substring), model, source_api, source_api_result, project_path (exact match against metadata.project_path), unmatched_only, days_back (unset by default - unlike search_logs's MCP tool, index has always returned unrestricted results and does not implicitly apply a 30-day window), and include_prompts (adds system_prompt/user_prompt, truncated to 500 chars, to each result).
| q[source_api_in][] | Array of strings Filter to these source_api values (Ransack in-predicate) |
| q[s] | string Sort expression, e.g. 'created_at desc' |
| page | integer Page number |
| per | integer Records per page (default 25, max 100; per_page also accepted) |
| per_page | integer Alias for per, matching search_logs's MCP tool param name (same 25/100 bounds) |
| template_id | string Filter by template hashid |
| workload_id | string Filter by workload hashid (matches all templates in that workload) |
| system_prompt_contains | string Case-insensitive substring to match in the system prompt |
| user_prompt_contains | string Case-insensitive substring to match in the user prompt |
| model | string Filter by model name |
| source_api | string Filter by source API (e.g. 'openai', 'anthropic', 'vertex') |
| source_api_result | string Filter by result status: success, failed, operational, unmatched |
| project_path | string Filter by exact match against metadata.project_path |
| unmatched_only | boolean Only return logs with no assigned template |
| days_back | integer Limit to logs created in the last N days (no default - unrestricted unless given) |
| include_prompts | boolean Include truncated system_prompt/user_prompt in each result |
| include_total | boolean Include X-Total-Count/X-Total-Pages response headers (default: false, to skip the COUNT(*) query on this frequently-polled endpoint) |
| X-API-Key | string Private API key for authentication |
| Authorization | string Bearer token with the private API key |
[- {
- "id": "string",
- "collector": "string",
- "source_api": "string",
- "metadata": { },
- "source_api_result": "string",
- "model": "string",
- "template_id": "string",
- "template_name": "string",
- "input_tokens": 0,
- "output_tokens": 0,
- "latency_ms": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_prompt": "string",
- "user_prompt": "string"
}
]Fetches full input/output content for a single log by its ID (hashid). Accepts any of this client's private credentials: the client's own private API key, a team member's UserClient private key, an AdminClientCredential, or the scoped, rotating key of the client's agent user (see Clients::AgentUserProvisioner) used by the change-suggestion coding agent to ground a fix in the log it was told to look at. Supports section/max_chars for large logs and search_query for snippet search. Only directly-collected logs are fetchable here (matching index's .client_logs restriction) - internally generated records (evals, synthetic logs) 404 even when the hashid is known.
| id required | string Log hashid |
| section | string full, beginning, or end (default: full) |
| max_chars | integer Maximum characters to return per content field |
| search_query | string Text to search for within the log content |
| include_thinking | boolean Include thinking/reasoning response content (default: false) |
| X-API-Key | string Any of this client's private credentials (see description) |
{- "id": "string",
- "url": "string",
- "collector": "string",
- "metadata": { },
- "model": "string",
- "source_api": "string",
- "source_api_result": "string",
- "template_id": "string",
- "template_name": "string",
- "input_tokens": 0,
- "output_tokens": 0,
- "latency_ms": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "system_prompt": "string",
- "user_prompt": "string",
- "output": "string",
- "truncated": true,
- "total_chars": {
- "system_prompt": 0,
- "user_prompt": 0,
- "output": 0
}, - "search_query": "string",
- "matches": {
- "system_prompt": [
- "string"
], - "user_prompt": [
- "string"
], - "output": [
- "string"
]
}, - "thinking_response": [
- "string"
]
}API endpoints for collecting user feedback on LLM request/response quality and accuracy
Creates a new feedback entry for LLM request monitoring and improvement purposes.
Field Guide - All fields are optional, but here's how to get the best results:
| api_key | string API key as query parameter |
| collector | string 🏷️ Optional collector identifier (can also be provided in request body) |
| X-API-Key | string API key for authentication |
| Authorization | string Bearer token with API key |
required | object |
{- "llm_request_log_feedback": {
- "llm_request_log_id": "string",
- "like": true,
- "explanation": "Great response! Very helpful and accurate.",
- "revised_output": "This is a dummy revised output",
- "llm_provider_unique_id": "req_1234567890abcdef",
- "original_output": "Dear John Doe,\n\nThank you for reaching out to us regarding the issue with your recent order #12345...",
- "client_unique_id": "email-service-1760025972258",
- "creator_unique_id": "user-789",
- "collector": "coolhand-node-0.1.0",
- "workload_hashid": "abc123def456",
- "sentiment": "like",
- "coolhand_fingerprint_id": "fp-abc123xyz",
- "focus_section": "This specific sentence needs improvement.",
- "focus_range": {
- "start": 100,
- "end": 150
}
}
}{- "id": "string",
- "client_id": "string",
- "llm_request_log_id": "string",
- "workload_id": "string",
- "like": true,
- "sentiment": "string",
- "creator_type": "string",
- "explanation": "string",
- "revised_output": "string",
- "llm_provider_unique_id": "string",
- "original_output": "string",
- "client_unique_id": "string",
- "creator_unique_id": "string",
- "collector": "string",
- "coolhand_fingerprint_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "warnings": [
- {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z"
}
], - "created_partial_id": "string",
- "feedback_partials": [
- {
- "id": "string",
- "llm_request_log_feedback_id": "string",
- "client_id": "string",
- "focus_section": "string",
- "focus_range": {
- "start": 0,
- "end": 0
}, - "sentiment": "like",
- "like": true,
- "explanation": "string",
- "creator_unique_id": "string",
- "coolhand_fingerprint_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}Returns this client's feedback entries. Supports Ransack search via q[...] params (e.g. q[sentiment_eq]=2 - sentiment is stored as the integer codes 0=dislike/1=neutral/2=like, which is what responses render as the strings 'dislike'/'neutral'/'like' - or q[created_at_gteq]=...), sorting via q[s] (e.g. created_at desc; when no q[s] is supplied, the endpoint applies a stable default sort of id desc so pagination is deterministic), and pagination via page/per (default 25, max 100). Filtering and sorting on original_output/revised_output are not supported. Accepts any of this client's private credentials - the client's own private API key, a team member's UserClient private key, an AdminClientCredential, or the scoped, rotating key of the client's agent user (see Clients::AgentUserProvisioner) used by the change-suggestion coding agent to ground a fix in the feedback it was told to look at - but not the public key, which is write-only and cannot read. List items omit original_output/revised_output (which can each hold up to 1GB) - fetch a specific item via GET /api/v2/llm_request_log_feedbacks/{id} to get the full text and any feedback_partials. Also sets X-Total-Count/X-Page/X-Per-Page/X-Total-Pages response headers - the same pagination signal every paginated v2 endpoint exposes (see GET /api/v2/llm_request_logs); the body's pagination object is kept for backward compatibility, not the pattern to rely on for new integrations.
| q[sentiment_eq] | integer Filter by sentiment integer code: 0 = dislike, 1 = neutral, 2 = like |
| q[workload_id_eq] | string Filter by workload hashid (the same value rendered as each item's workload_id) |
| q[s] | string Sort expression, e.g. 'created_at desc' |
| page | integer Page number |
| per | integer Records per page (default 25, max 100) |
| X-API-Key | string Any of this client's private credentials (see description) |
| Authorization | string Bearer token with the private API key |
{- "feedback": [
- {
- "id": "string",
- "client_id": "string",
- "llm_request_log_id": "string",
- "workload_id": "string",
- "like": true,
- "sentiment": "string",
- "creator_type": "string",
- "explanation": "string",
- "llm_provider_unique_id": "string",
- "client_unique_id": "string",
- "creator_unique_id": "string",
- "collector": "string",
- "coolhand_fingerprint_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "current_page": 0,
- "per_page": 0,
- "total_count": 0,
- "total_pages": 0,
- "has_next_page": true,
- "has_prev_page": true
}
}Updates an existing feedback entry. Only specific fields can be updated - identity fields are immutable.
Partial Feedback Updates:
When partial_id is provided in the request body, the update is applied to that specific FeedbackPartial
instead of the parent feedback. This is useful when adding explanations to partial feedback (highlighted text sections).
The response will include updated_partial_id to confirm which partial was updated.
Updatable Fields (Parent Feedback):
Updatable Fields (FeedbackPartial - when partial_id is provided):
Immutable Fields (cannot be updated):
Note: After a successful update, if the feedback is not already matched to a log and has original_output, the fuzzy matching job will be re-triggered to attempt matching.
| id required | string Feedback hashid |
| X-API-Key | string API key for authentication |
| Authorization | string Bearer token with API key |
object |
{- "llm_request_log_feedback": {
- "like": true,
- "explanation": "string",
- "revised_output": "string",
- "original_output": "string",
- "llm_provider_unique_id": "string",
- "collector": "string",
- "client_unique_id": "string",
- "workload_hashid": "string",
- "partial_id": "string",
- "sentiment": "like"
}
}{- "id": "string",
- "client_id": "string",
- "llm_request_log_id": "string",
- "workload_id": "string",
- "like": true,
- "sentiment": "string",
- "creator_type": "string",
- "explanation": "string",
- "revised_output": "string",
- "llm_provider_unique_id": "string",
- "original_output": "string",
- "client_unique_id": "string",
- "creator_unique_id": "string",
- "collector": "string",
- "coolhand_fingerprint_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_partial_id": "string",
- "feedback_partials": [
- {
- "id": "string",
- "llm_request_log_feedback_id": "string",
- "client_id": "string",
- "focus_section": "string",
- "focus_range": {
- "start": 0,
- "end": 0
}, - "sentiment": "like",
- "like": true,
- "explanation": "string",
- "creator_unique_id": "string",
- "coolhand_fingerprint_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}Fetches a single feedback entry by hashid, including original_output, revised_output, and any feedback_partials - the full record that GET /api/v2/llm_request_log_feedbacks omits from list results. Accepts any of this client's private credentials - the client's own private API key, a team member's UserClient private key, an AdminClientCredential, or the scoped, rotating key of the client's agent user (see Clients::AgentUserProvisioner) used by the change-suggestion coding agent to ground a fix in the feedback it was told to look at - but not the public key, which is write-only and cannot read.
| id required | string Feedback hashid |
| X-API-Key | string Any of this client's private credentials (see description) |
| Authorization | string Bearer token with the private API key |
{- "id": "string",
- "client_id": "string",
- "llm_request_log_id": "string",
- "workload_id": "string",
- "like": true,
- "sentiment": "string",
- "creator_type": "string",
- "explanation": "string",
- "original_output": "string",
- "revised_output": "string",
- "llm_provider_unique_id": "string",
- "client_unique_id": "string",
- "creator_unique_id": "string",
- "collector": "string",
- "coolhand_fingerprint_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "feedback_partials": [
- {
- "id": "string",
- "llm_request_log_feedback_id": "string",
- "client_id": "string",
- "focus_section": "string",
- "focus_range": {
- "start": 0,
- "end": 0
}, - "sentiment": "like",
- "like": true,
- "explanation": "string",
- "creator_unique_id": "string",
- "coolhand_fingerprint_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}Returns a list of all inference models tracked by Coolhand, including per-token pricing metadata.
Authentication:
Authentication is optional. Unauthenticated callers are rate-limited (see below).
Authenticated callers bypass the rate limit entirely. Pass a public API key via the
X-API-Key header or as a Bearer token in the Authorization header. Sign up at
coolhand.ai to get a free API key. A private key is not accepted here — this endpoint
only recognizes public keys (and rejects a private key the same way it would an invalid
one).
How pricing data is gathered:
Pricing data is collected by the Godfrey agent, an automated system that
periodically fetches and parses pricing pages published by model providers.
All records undergo human review before being considered authoritative.
The sources field on each record links to the original provider pricing
page used as the data source.
Cost units:
Every _per_token field is a raw USD cost-per-token value. Multiply by 1,000,000 for
the "per 1M tokens" pricing commonly published by providers.
per_cache_storage_cost_per_hour_per_token is the one exception: it's priced per hour
of storage, not per request — an ongoing hourly charge for holding tokens in a cache
(as Gemini's explicit context caching bills), not a one-time per-token cost.
Rate limiting:
Unauthenticated requests are rate limited to 1 request per minute per IP address.
Exceeding the limit returns a 429 Too Many Requests response. Authenticated
requests are never rate limited.
| q[source_api_eq] | string Filter by API identifier (e.g. 'openai', 'anthropic') |
| q[model_eq] | string Filter by the exact model identifier passed in API calls to the source API itself — e.g. if your code calls OpenAI with model: 'gpt-4o', pass q[model_eq]=gpt-4o here, not the display name (see the model field on the response schema below). Combine with q[source_api_eq] to fetch a single model, since (source_api, model) is unique. |
| q[provider_eq] | string Filter by provider name (e.g. 'OpenAI', 'Anthropic') |
| q[s] | string Sort expression, e.g. 'model desc'. Defaults to source_api then model. Other ransackable columns (pricing, deprecation_notes, sources, not_human_reviewed, slug) can be filtered the same q[column_predicate] way; not enumerated individually here since #index only ever shows the summary fields documented in the response schema below — see GET /api/v2/inference_apis/{id} for the full field set those filter. |
| available_for_bakeoff | boolean If true, only return bakeoff-eligible models. Not a Ransack predicate (not under q[...]) — like include_deprecated below, it changes which set is returned rather than narrowing a search. |
| include_deprecated | boolean Include deprecated models. Defaults to true. Pass false to hide them. Not a Ransack predicate — it changes which set is returned rather than narrowing it. |
| q[id_eq] | string NOT a supported filter — id was intentionally removed from ransackable_attributes. Documented here only to show the resulting contract: an unrecognized predicate returns 400 rather than silently ignoring the filter and returning the whole catalog. |
| X-API-Key | string API key for authentication |
| Authorization | string Bearer token with API key |
[- {
- "id": 0,
- "source_api": "string",
- "model": "string",
- "display_name": "string",
- "provider": "string",
- "per_input_cost_per_token": 0.1,
- "per_output_cost_per_token": 0.1,
- "per_cached_input_cost_per_token": 0.1,
- "per_cache_creation_input_cost_per_token": 0.1,
- "per_cache_creation_5m_input_cost_per_token": 0.1,
- "per_cache_creation_1h_input_cost_per_token": 0.1,
- "per_cache_storage_cost_per_hour_per_token": 0.1,
- "available_for_bakeoff": true,
- "deprecated_at": "2019-08-24T14:15:22Z",
- "deprecation_notes": "string",
- "sources": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]Returns every field #index's summary response has, plus the fields #index omits: the
internal not_human_reviewed review-status flag, the slug used in this model's public
page URL, and the batch and reasoning-output per-token pricing columns (index has
never exposed either). Same authentication and rate limiting as #index.
| id required | string The model's slug (e.g. 'openai-gpt-4o'), matching its public page URL at /inference-apis/:slug — not the internal numeric id, which isn't a stable public identifier and isn't filterable via q[...] on #index either. |
| X-API-Key | string API key for authentication |
| Authorization | string Bearer token with API key |
{- "id": 0,
- "slug": "string",
- "source_api": "string",
- "model": "string",
- "display_name": "string",
- "provider": "string",
- "per_input_cost_per_token": 0.1,
- "per_output_cost_per_token": 0.1,
- "per_cached_input_cost_per_token": 0.1,
- "per_cache_creation_input_cost_per_token": 0.1,
- "per_cache_creation_5m_input_cost_per_token": 0.1,
- "per_cache_creation_1h_input_cost_per_token": 0.1,
- "per_cache_storage_cost_per_hour_per_token": 0.1,
- "available_for_bakeoff": true,
- "deprecated_at": "2019-08-24T14:15:22Z",
- "deprecation_notes": "string",
- "sources": "string",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "not_human_reviewed": true,
- "per_input_cost_batch_per_token": 0.1,
- "per_output_cost_batch_per_token": 0.1,
- "per_reasoning_output_cost_per_token": 0.1
}Attaches an existing LlmRequestLogFeedback to an optimization as supporting evidence. Requires a private credential (the client's own private API key, a team member's UserClient private key, or an AdminClientCredential) or a Doorkeeper Bearer token - the public api_key is rejected on this endpoint.
| optimization_id required | string Optimization hashid |
| X-API-Key | string Any of this client's private credentials (see description) - not the public api_key |
| Authorization | string Bearer token with the private API key, or a Doorkeeper access token |
| feedback_id required | string Feedback hashid to link |
| note | string or null Optional note explaining the link |
{- "feedback_id": "string",
- "note": "string"
}{- "id": 0,
- "optimization_id": "string",
- "note": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "feedback_id": "string"
}Removes a feedback-evidence link from an optimization. Requires a private credential (see the create operation's description) - the public api_key is rejected.
| optimization_id required | string Optimization hashid |
| id required | integer The link's raw integer id, as returned in the create response's |
| X-API-Key | string Any of this client's private credentials (see description) - not the public api_key |
| Authorization | string Bearer token with the private API key, or a Doorkeeper access token |
{- "error": "string"
}Attaches an existing LlmRequestLog to an optimization as supporting evidence. Requires a private credential (see the feedback-links create operation's description) - the public api_key is rejected on this endpoint.
| optimization_id required | string Optimization hashid |
| X-API-Key | string Any of this client's private credentials (see description) - not the public api_key |
| Authorization | string Bearer token with the private API key, or a Doorkeeper access token |
| log_id required | string LLM request log hashid to link |
| note | string or null Optional note explaining the link |
{- "log_id": "string",
- "note": "string"
}{- "id": 0,
- "optimization_id": "string",
- "note": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "log_id": "string"
}Removes a log-evidence link from an optimization. Requires a private credential (see the create operation's description) - the public api_key is rejected.
| optimization_id required | string Optimization hashid |
| id required | integer The link's raw integer id, as returned in the create response's |
| X-API-Key | string Any of this client's private credentials (see description) - not the public api_key |
| Authorization | string Bearer token with the private API key, or a Doorkeeper access token |
{- "error": "string"
}Attaches an existing LlmRequestEval to an optimization as supporting evidence. Requires a private credential (see the feedback-links create operation's description) - the public api_key is rejected on this endpoint.
| optimization_id required | string Optimization hashid |
| X-API-Key | string Any of this client's private credentials (see description) - not the public api_key |
| Authorization | string Bearer token with the private API key, or a Doorkeeper access token |
| eval_id required | string LLM request eval hashid to link |
| note | string or null Optional note explaining the link |
{- "eval_id": "string",
- "note": "string"
}{- "id": 0,
- "optimization_id": "string",
- "note": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "eval_id": "string"
}Removes an eval-evidence link from an optimization. Requires a private credential (see the create operation's description) - the public api_key is rejected.
| optimization_id required | string Optimization hashid |
| id required | integer The link's raw integer id, as returned in the create response's |
| X-API-Key | string Any of this client's private credentials (see description) - not the public api_key |
| Authorization | string Bearer token with the private API key, or a Doorkeeper access token |
{- "error": "string"
}Records a change suggestion (a proposed fix/PR) against the authenticated client.
suggestion_type - one of setup, optimization_fix.
status - one of draft, open, merged, closed, awaiting_client_review,
incomplete, awaiting_repo_selection.
The suggestion is always scoped to the authenticated client - any client_id in the
request body is ignored.
Requires a private credential (the client's own private API key, a team member's
UserClient private key, or an AdminClientCredential) or a Doorkeeper Bearer token - the
public api_key is rejected on this endpoint.
| X-API-Key | string Any of this client's private credentials (see description) - not the public api_key |
| Authorization | string Bearer token with the private API key, or a Doorkeeper access token |
required | object |
{- "change_suggestion": {
- "suggestion_type": "setup",
- "status": "draft",
- "branch_name": "string",
- "pr_id": 0,
- "pr_copy": "string",
- "diff": "string",
- "github_url": "string"
}
}{- "id": 0,
- "status": "created",
- "message": "string"
}Uploads a document as a ClientFile, e.g. so a tool like coolhand-cli can attach project files to a client. id is the file's hashid. metadata is an optional free-form object for client-supplied context - see the project_path convention in the Understanding an LLM Request Log guide's Metadata section, which applies here too. Uploads always land as draft: status is not settable through this endpoint, since nothing validates an uploaded file's content - promote a file to published from the admin UI once it's been reviewed. Requires the private API key - the public key cannot upload files. Files are currently proxied through the API and capped at 20MB; larger uploads are not yet supported.
| X-API-Key | string Private API key for authentication |
| Authorization | string Bearer token with the private API key |
Display name for the file
{- "id": "string",
- "name": "string",
- "file_type": "string",
- "status": "string",
- "description": "string",
- "metadata": { },
- "created_at": "2019-08-24T14:15:22Z"
}Displays the browser-based token authorization page for the Coolhand CLI.
Flow overview:
GET /cli/auth?redirect_uri=http://localhost:<port>/cb&state=<random>&scope=<scope>./users/sign_in,
which stores the CLI auth URL as the post-login return URL.redirect_uri with token(s) in the query string
(see POST /cli/auth).scope parameter:
public (default) — returns only the public API key (token). Use for
log ingest and REST API calls.private — returns both the public API key (token) and the private
MCP key (private_token). The UI displays an additional red warning
banner and a second confirmation checkbox; the CLI Connect button is
disabled until both checkboxes are checked. Only request private scope
when the CLI needs to call the /mcp endpoint.Security: redirect_uri must be an http:// URL with host
localhost, 127.0.0.1, or ::1. HTTPS and non-localhost hosts are
rejected with 400 Bad Request.
| redirect_uri required | string Localhost HTTP callback URL for the CLI (e.g. |
| state required | string Opaque CSRF state string echoed back in the callback. Max 256 characters. |
| scope | string Key scope to request: |
Processes the CLI auth form submission and redirects the browser to the CLI's local callback URL with API key(s) in the query string.
Callback query parameters:
| Parameter | Always present | Description |
|---|---|---|
token |
Only when scope[] includes public |
Public API key (ch_pub_*). Use for log ingest and REST API calls. |
private_token |
Only when scope[] includes private |
Private MCP key (ch_priv_*). Required for POST /mcp. |
state |
✓ | Echoed back from the request — verify this matches your initial state to prevent CSRF. |
client_name |
✓ | Human-readable name of the selected Coolhand account. |
client_id |
✓ | Hashid of the selected Coolhand account. |
At least one of token / private_token is always present — submitting an
empty scope[] is rejected with 422 Unprocessable Entity.
Using the private key:
Pass private_token as the X-API-Key header when calling POST /mcp.
The public token is used everywhere else (SDK configuration, ingest endpoint).
Never embed the private key in client-side code or commit it to source control.
New client creation:
Pass new_client=1 and new_client_name=<name> instead of client_id to
create a new Coolhand account on the fly. The callback will carry the new
account's freshly generated keys.
Localhost HTTP callback URL (must match the GET request value)
| id | integer LLM Request Log ID |
| collector | string or null Optional name/stamp identifying the collection method (e.g., 'nodejs-sdk-v1.2.0', 'ruby-gem-v2.1.3') |
| metadata | object Optional free-form client-supplied context (e.g. { "project_path": "..." }) |
| created_at | string <date-time> (shared_created_at) Date and time when object was created formatted according to RFC 3339. Timezone is UTC |
| updated_at | string <date-time> (shared_updated_at) Date and time when object was updated formatted according to RFC 3339. Timezone is UTC |
{- "id": 46512,
- "collector": "nodejs-sdk-v1.2.0",
- "metadata": {
- "project_path": "/Users/me/my-project"
}, - "created_at": "2026-08-24T13:56:42+00:00",
- "updated_at": "2026-08-24T13:56:42+00:00"
}| id | string Unique hashid identifier for the feedback entry. Use this to reference the feedback in update requests. |
| client_id | string Hashid of the client that owns this feedback entry. |
| llm_request_log_id | string or null 🎯 Exact Match - Hashid of the LLM request log this feedback is linked to. Provides exact matching to connect feedback to a specific logged request. |
| workload_id | string or null 📦 Workload Association - Hashid of the workload this feedback is associated with. Set automatically when a valid workload_hashid is provided in the request. |
| like | boolean or null 👍 Low Signal - Boolean like/dislike rating (deprecated, use sentiment instead). Computed from sentiment for backwards compatibility: like=true, dislike=false, neutral/nil=nil. |
| sentiment | string or null Enum: "like" "dislike" "neutral" 🎭 Sentiment Rating - String sentiment value: 'like', 'dislike', or 'neutral'. Preferred over boolean 'like' field. Takes precedence if both are provided. |
| creator_type | string or null Enum: "human" "agent" "unknown" 🧑🤝🤖 Creator Type - What kind of creator submitted this feedback: 'human' (a person), 'agent' (an AI agent or automated tool), or 'unknown'. Defaults to 'unknown' when omitted. |
| explanation | string or null 💬 Medium Signal - End user explanation of why the response was good or bad. Valuable qualitative data for understanding user preferences and improving model performance. |
| revised_output | string or null ⭐ Best Signal - End user revision of the LLM response. The highest value data for improving quality scores. This is the user's improved version of what the AI should have said. |
| llm_provider_unique_id | string or null 🎯 Exact Match - The x-request-id from the LLM API response (e.g., 'req_xxxxxxx'). Provides exact matching to connect feedback to the specific LLM provider request. |
| original_output | string or null 🔍 Fuzzy Match - The original LLM response text. Provides fuzzy matching but isn't 100% reliable. Use when you don't have llm_provider_unique_id or llm_request_log_id. |
| client_unique_id | string or null 🔗 Your Internal Matcher - Connect to an identifier from your system for internal matching. This helps you correlate feedback with your own request tracking system. |
| creator_unique_id | string or null 👤 User Tracking - Unique ID to match feedback to the end user who created it. Useful for analyzing feedback patterns by user and preventing duplicate feedback. |
| collector | string or null 🏷️ Metadata - Optional name/stamp identifying the collection method or SDK version. Helps track which system or version collected the feedback. |
| coolhand_fingerprint_id | string or null 🔒 Optional - Unique fingerprint ID set by the CoolhandJS SDK (https://github.com/Coolhand-Labs/coolhand-js). DO NOT set this field when calling the API directly - it is reserved for CoolhandJS. |
| created_at | string <date-time> (shared_created_at) Date and time when object was created formatted according to RFC 3339. Timezone is UTC |
| updated_at | string <date-time> (shared_updated_at) Date and time when object was updated formatted according to RFC 3339. Timezone is UTC |
{- "id": "abc123xyz789",
- "client_id": "xyz789abc123",
- "llm_request_log_id": "abc123xyz789",
- "workload_id": "xyz789abc123",
- "like": true,
- "sentiment": "like",
- "creator_type": "human",
- "explanation": "Great response! Very helpful and accurate.",
- "revised_output": "This is a dummy revised output",
- "llm_provider_unique_id": "req_1234567890abcdef",
- "original_output": "Dear John Doe,\n\nThank you for reaching out to us regarding the issue with your recent order #12345...",
- "client_unique_id": "email-service-1760025972258",
- "creator_unique_id": "user-789",
- "collector": "coolhand-node-0.1.0",
- "coolhand_fingerprint_id": "fp_abc123xyz789",
- "created_at": "2026-08-24T13:56:42+00:00",
- "updated_at": "2026-08-24T13:56:42+00:00"
}| id | string Client file hashid |
| name | string Display name for the file |
| file_type | string One of slide_deck, report, document |
| status | string One of draft, published, archived |
| description | string or null Optional free-text description |
object Optional free-form client-supplied context (e.g. { "project_path": "..." }) | |
| created_at | string <date-time> (shared_created_at) Date and time when object was created formatted according to RFC 3339. Timezone is UTC |
{- "id": "abc123",
- "name": "Q1 Report",
- "file_type": "document",
- "status": "draft",
- "description": "string",
- "metadata": {
- "project_path": "/Users/me/my-project"
}, - "created_at": "2026-08-24T13:56:42+00:00"
}