DocsQuickstart
Docs
Quickstart
Make a first Compass API call in five minutes.
The explainable dietary decision layer for AI agents.
1. Get a Sandbox key
Create a Sandbox account and copy the key that starts with cmp_test_. Paid tiers use keys that start with cmp_live_. Send the key in the X-Compass-API-Key header.
2. Call Search
Set COMPASS_API_KEY in your shell or runtime environment. The examples below do not print the key in source code.
Start with a natural-language restaurant search.
$headers = @{
"X-Compass-API-Key" = $env:COMPASS_API_KEY
"X-Compass-Mode" = "fast"
}
$body = @'
{
"query": "plant-based sushi in Austin",
"limit": 5
}
'@
Invoke-RestMethod `
-Method Post `
-Uri "https://api.compassfoodtechnologies.com/v1/search" `
-Headers $headers `
-ContentType "application/json" `
-Body $body3. Run the example locally
If you are using the JavaScript tab, create a local Node file named first-call.mjs with that example, then run it with npm:
npm init -y npm pkg set type=module node first-call.mjs
Response fields to inspect first
| Field | Type | Notes |
|---|---|---|
| results[] | array | Ranked restaurants for the submitted query. |
| results[].match_for_profile | object | Decision, confidence, reason codes, and risk flags when a profile is sent. |
| evidence[] | array | Source pointers used by rich responses. |
| source_freshness | object | Age of the oldest and newest signal plus refresh guidance. |
unknown is a valid conservative decision when evidence is insufficient, conflicting, or stale. Treat it as guidance to verify details with the restaurant.
Terminology
| Field | Type | Notes |
|---|---|---|
| Account plan | quota and features | Controls monthly quota, endpoint access, support level, and billing. |
| Evidence tier | source strength | Describes the source quality and freshness behind an evidence item. |