Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Intelligence Endpoints

Intelligence endpoints provide PRISM scoring, pattern detection, and recommendations.

Pre-computed PRISM scores from Postgres.

GET /v1/intelligence/prism?from=2024-01-01T00:00:00Z&limit=100
Authorization: Bearer gck_your_key
ParameterTypeDefaultDescription
session_idstringFilter by session ID
fromISO8601Start time
toISO8601End time
limitinteger100Max records (max 1000)
offsetinteger0Pagination offset

Response:

{
"scores": [
{
"session_id": "...",
"timestamp": "2024-01-01T12:00:00Z",
"prism_score": 7.2,
"pq": 8.0,
"ie": 6.5,
"vd": 7.0,
"tu": 7.5,
"af": 6.0,
"coaching_notes": "Focus on iteration efficiency...",
"anti_patterns": ["vague_prompt"],
"scoring_method": "llm"
}
],
"total": 42
}

Lowest-scoring prompts with text and coaching notes.

GET /v1/intelligence/worst-prompts?limit=10
Authorization: Bearer gck_your_key

Real-time heuristic PQ scoring (stateless — does not persist).

POST /v1/intelligence/score-prompt
Authorization: Bearer gck_your_key
Content-Type: application/json
{
"prompt_text": "Fix the bug in auth.ts"
}

Response: PRISM score object with all dimension scores.

Minimum prompt length: 5 characters.

Waste pattern detection results.

GET /v1/intelligence/waste?limit=100
Authorization: Bearer gck_your_key
ParameterTypeDefaultDescription
patternstringFilter by pattern name
limitinteger100Max records (max 500)
offsetinteger0Pagination offset

Throttle impact analysis.

GET /v1/intelligence/throttle?limit=100
Authorization: Bearer gck_your_key
ParameterTypeDefaultDescription
detectorstringFilter by detector name
limitinteger100Max records (max 500)
offsetinteger0Pagination offset

Model and tier recommendations based on usage patterns.

GET /v1/intelligence/rightsizing
Authorization: Bearer gck_your_key

Persisted recommendations from the recommendation engine.

GET /v1/intelligence/recommendations?status=new&limit=50
Authorization: Bearer gck_your_key
ParameterTypeDefaultDescription
statusstringFilter: new, acknowledged, resolved, dismissed
categorystringFilter by category
limitinteger50Max records (max 200)
offsetinteger0Pagination offset

POST /v1/intelligence/recommendations/:id/status

Section titled “POST /v1/intelligence/recommendations/:id/status”

Update recommendation status.

POST /v1/intelligence/recommendations/abc123/status
Authorization: Bearer gck_your_key
Content-Type: application/json
{
"status": "resolved"
}

Valid statuses: new, acknowledged, resolved, dismissed.

Cross-session behavioral coaching insights.

GET /v1/intelligence/coaching
Authorization: Bearer gck_your_key