Appearance
OpenAI-Compatible API
VeriPrompt exposes an OpenAI-compatible REST API so any OpenAI SDK, LangChain, Vercel AI, or plain curl works by changing two settings: baseURL and api_key.
How It Works
VeriPrompt acts as an AI gateway between your application and AI providers. Instead of calling OpenAI (or Anthropic, Google, etc.) directly, your app calls VeriPrompt using a VeriPrompt API key (sk-vp-...). VeriPrompt then routes the request to the best provider based on your routing policies, using the provider credentials you configured in the dashboard.
Your App → VeriPrompt Gateway → OpenAI / Anthropic / Google / ...
(sk-vp-...) (routes & manages) (your provider keys, configured in dashboard)Before You Start
- Configure at least one AI provider in Settings > Provider Models with a valid provider API key.
- Create a VeriPrompt API key in Settings > External API Users — this gives you a
sk-vp-...key. - Use the
sk-vp-...key as yourapi_key(not your raw OpenAI/Anthropic key).
Quick Start
Python
python
from openai import OpenAI
client = OpenAI(
base_url="https://app.veriprompt.tech/api/v1",
api_key="sk-vp-..." # Your VeriPrompt API key
)
response = client.chat.completions.create(
model="auto", # Let VeriPrompt route to the best provider
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
max_tokens=100
)
print(response.choices[0].message.content)Node.js
typescript
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://app.veriprompt.tech/api/v1',
apiKey: 'sk-vp-...',
});
const completion = await client.chat.completions.create({
model: 'auto',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(completion.choices[0].message.content);curl
bash
curl https://app.veriprompt.tech/api/v1/chat/completions \
-H "Authorization: Bearer sk-vp-..." \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 100
}'Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/v1/chat/completions | Create a chat completion |
GET | /api/v1/models | List available models |
GET | /api/v1/models/{model_id} | Get model details |
Model Routing
VeriPrompt's key feature is intelligent model routing. Use these model ID formats:
| Format | Example | Behavior |
|---|---|---|
auto | "auto" | Route to best available provider |
auto:fast | "auto:fast" | Prioritize speed |
auto:quality | "auto:quality" | Prioritize quality |
auto:cheap | "auto:cheap" | Prioritize cost |
provider/model | "openai/gpt-4o" | Specific provider and model |
alias/model | "mycloud/llm-v2" | Custom provider slug alias |
policy:{id} | "policy:abc123" | Use a specific routing policy |
group:{id} | "group:def456" | Use a provider group |
| Bare model | "gpt-4o" | Auto-detect provider from catalog |
Provider Slug Aliases
Admins can create custom slug aliases in Settings > Provider Slugs to map prefixes to provider types. For example, creating alias mycloud -> OPENAI lets users send model: "mycloud/gpt-4o".
The resolution order is: company aliases > global aliases > built-in slugs.
Built-in slugs include: openai, anthropic, google, mistral, cohere, meta, deepseek, groq, perplexity, xai, azure, azure-openai, together, fireworks, replicate, ollama, lmstudio, openrouter.
Authentication
All requests require a VeriPrompt Bearer token (not a raw provider key):
Authorization: Bearer sk-vp-...Common Mistake
Do not use your OpenAI key (sk-...), Anthropic key (sk-ant-...), or other provider keys here. Those keys are configured separately in Settings > Provider Models. The Authorization header must contain a VeriPrompt gateway key (sk-vp-... or legacy vp-gw_sk_...).
Create API keys in Settings > External API Users with type OPENAI_COMPAT to get keys with the sk-vp- prefix. Legacy vp-gw_sk_ keys also work.
Rate Limits
Rate limit headers are returned on every successful response:
| Header | Description |
|---|---|
x-ratelimit-remaining-requests | Remaining requests this month |
x-ratelimit-remaining-tokens | Remaining tokens this month |
x-request-id | Unique request identifier |
VeriPrompt Extensions
Responses include a x_veriprompt object with routing metadata:
json
{
"x_veriprompt": {
"execution_id": "exec_...",
"provider_type": "OPENAI",
"provider_name": "OpenAI GPT-4o",
"model_used": "gpt-4o",
"response_time_ms": 1234
}
}Custom Headers
Control routing behavior with these optional request headers:
| Header | Description |
|---|---|
X-VeriPrompt-Policy-Id | Override routing policy |
X-VeriPrompt-Session-Id | Session affinity for provider consistency |
X-VeriPrompt-Quality | Quality hint (fast, quality, cheap) |
Error Format
All errors follow the OpenAI error format:
json
{
"error": {
"message": "Human-readable description",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}| HTTP Status | Error Type | Common Codes |
|---|---|---|
| 400 | invalid_request_error | missing_parameter, unsupported_parameter |
| 401 | authentication_error | invalid_api_key, key_expired, key_revoked |
| 403 | server_error | byok_required, ip_not_allowed |
| 404 | not_found_error | model_not_found |
| 429 | rate_limit_error | rate_limit_exceeded |
| 500 | server_error | internal_error |
| 502 | server_error | all_providers_failed |
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
Invalid API key format. Expected prefix: sk-vp- or vp-gw_sk_ | Using a raw provider key (e.g., sk-... from OpenAI) | Create a VeriPrompt key in Settings > External API Users |
Model 'X' is not available | Model not configured for your company | Import the model in Settings > Provider Models, or use model: "auto" |
No active AI providers available | No providers configured or key decryption failure | Check Settings > Provider Models for active providers with valid API keys |
BYOK_REQUIRED | Free tier requires your own provider keys | Add at least one provider API key in Settings > Provider Models |
Rate limit exceeded | Monthly quota exhausted | Upgrade your plan or wait for the monthly reset |
Current Limitations (MVP)
- No streaming —
stream: truereturns 400. Streaming support is planned. - No tool calling — Function/tool calling is not yet mapped.
- No n > 1 — Multiple completions are not supported.
- No logprobs — Always returns
null.
