Deterministic pre-flight credit quote for a study plan_spec
POST
/credits/estimate
const url = 'https://app.discotrace.com/api/v1/credits/estimate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"plan_spec":{"roster":"consumer","surfaces":["openai","claude","gemini","perplexity","google_ai_overviews"],"personas":["VP of Operations","Head of IT"],"situations":["Replacing legacy tool","Evaluating compliance fit"],"active_cells":9,"precision":"standard","scope":"pass1_baseline","cadence":"one_off","include_preference":true,"shown_cells":4,"edit_tests":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.discotrace.com/api/v1/credits/estimate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "plan_spec": { "roster": "consumer", "surfaces": [ "openai", "claude", "gemini", "perplexity", "google_ai_overviews" ], "personas": [ "VP of Operations", "Head of IT" ], "situations": [ "Replacing legacy tool", "Evaluating compliance fit" ], "active_cells": 9, "precision": "standard", "scope": "pass1_baseline", "cadence": "one_off", "include_preference": true, "shown_cells": 4, "edit_tests": 1 } }'Requires read scope. Computes exact credits (1 credit = 1 completed graded answer on Consumer surfaces), stage breakdown, total AI responses, and whether the run fits inside auto_approve_credits.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
plan_spec
Study matrix, AI surface roster, precision preset, and scope configuration.
object
roster
string
surfaces
Array<string>
Example
[ "openai", "claude", "gemini", "perplexity", "google_ai_overviews"]personas
Array<string>
Example
[ "VP of Operations", "Head of IT"]situations
Array<string>
Example
[ "Replacing legacy tool", "Evaluating compliance fit"]active_cells
integer
Example
9precision
string
scope
string
cadence
string
include_preference
Run supplied-page Preference diagnostics (default true on Pass 1, false on Pass 2+).
boolean
shown_cells
integer
Example
4edit_tests
integer
Example
1Responses
Section titled “Responses”Deterministic credit and volume quote.
Structured error payload with remediation link (resolveUrl).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
retryable
required
boolean
resolveUrl
required
string format: uri
details
object
key
additional properties
any
Example
{ "error": { "code": "insufficient_scope", "message": "API key is missing required scope 'run'.", "retryable": false, "resolveUrl": "https://app.discotrace.com/w/acme/api" }}Structured error payload with remediation link (resolveUrl).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
retryable
required
boolean
resolveUrl
required
string format: uri
details
object
key
additional properties
any
Example
{ "error": { "code": "insufficient_scope", "message": "API key is missing required scope 'run'.", "retryable": false, "resolveUrl": "https://app.discotrace.com/w/acme/api" }}