curl
Use raw HTTP requests for quick smoke tests, automation scripts and minimal server integrations.
Configuration
- Export
PRISMATIC_API_KEYin your shell before sending requests. - Use
Authorization: Bearer $PRISMATIC_API_KEYfor OpenAI-compatible endpoints. - Use
x-api-keyandanthropic-versionfor/v1/messagesand/v1/messages/count_tokens. - Add
Content-Type: application/jsonon every POST request.
Example
export PRISMATIC_API_KEY="pa_YOUR_KEY" export PRISMATIC_BASE_URL="https://api.prismaticapi.com/v1"
curl https://api.prismaticapi.com/v1/chat/completions \
-H "Authorization: Bearer $PRISMATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{ "role": "system", "content": "You are a concise release assistant." },
{ "role": "user", "content": "Write three product taglines." }
],
"stream": false,
"max_tokens": 400
}'curl https://api.prismaticapi.com/v1/messages \
-H "x-api-key: $PRISMATIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 400,
"messages": [
{ "role": "user", "content": "Draft a deployment checklist." }
]
}'Recommended models
claude-sonnet-4-6— strong model for reasoning, refactors and coding agents.claude-haiku-4-5— fast option for autocomplete, small questions and lightweight tasks.deepseek-v3-2or another public ID — alternative based on your active catalog and plan.
Troubleshooting
Authentication error
Check that the API key has no extra spaces and has not been revoked in the dashboard.
Model rejected
Use a public model ID returned by GET /v1/models; do not use labels or aliases.
Connection issue
Confirm the configured base URL is exactly the one shown above and that your network allows HTTPS to api.prismaticapi.com.
Notes
- Use
curl -Nfor streaming tests so chunks are printed as they arrive. - A
401response means the API key is missing, revoked or invalid. - A
402response means quota or PAYG funding blocked the request.