Appearance
API Quick Start
Get a successful API response in under 5 minutes.
Prerequisites
- A VeriPrompt account
- At least one AI provider configured in Settings > Provider Models (OpenAI, Anthropic, Google, etc.)
- A VeriPrompt API key (see Step 1 below)
Important: VeriPrompt API Keys vs. Provider Keys
VeriPrompt does not accept raw provider API keys (e.g., sk-ant-... from Anthropic or sk-... from OpenAI) in the Authorization header. You must use a VeriPrompt gateway key (sk-vp-... or vp-gw_sk_...).
Your provider API keys are configured separately in the VeriPrompt dashboard under Settings > Provider Models — VeriPrompt uses them internally to route requests to the correct provider on your behalf.
1. Create a VeriPrompt API Key
- Log in to the VeriPrompt dashboard.
- Navigate to Settings > External API Users.
- Click Create Key and select the scope (e.g., Execute Only for chat completions).
- Copy the key immediately — it is only shown once. The key starts with
sk-vp-.
bash
export VERIPROMPT_API_KEY="sk-vp-your-key-here"2. Send a Chat Completion (OpenAI-Compatible)
VeriPrompt acts as an AI gateway — point any OpenAI-compatible SDK at VeriPrompt's base URL and use your VeriPrompt API key. VeriPrompt routes your request to the best available provider based on your configured routing policies:
bash
curl -X POST https://app.veriprompt.tech/api/v1/chat/completions \
-H "Authorization: Bearer $VERIPROMPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Write a two-sentence summary of AI routing."}
],
"max_tokens": 200
}'3. Check the Response
A successful response looks like:
json
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"choices": [{
"message": {
"role": "assistant",
"content": "AI routing dynamically selects the best model..."
}
}],
"usage": {
"prompt_tokens": 15,
"completion_tokens": 42,
"total_tokens": 57
}
}4. Use with OpenAI SDKs
Python
python
from openai import OpenAI
client = OpenAI(
api_key="sk-vp-your-key-here",
base_url="https://app.veriprompt.tech/api/v1"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Node.js / TypeScript
typescript
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-vp-your-key-here',
baseURL: 'https://app.veriprompt.tech/api/v1',
});
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);5. Execute a Stored Prompt
If you have prompts stored in the VeriPrompt dashboard, execute them via the MCP endpoint:
bash
curl -X POST https://app.veriprompt.tech/api/mcp \
-H "Authorization: Bearer $VERIPROMPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "execute_stored_prompt",
"arguments": {
"promptId": "prompt_123_abc"
}
},
"id": 1
}'Troubleshooting
"Invalid API key format" Error
json
{"error":{"message":"Invalid API key format. Expected prefix: sk-vp- or vp-gw_sk_","type":"authentication_error","code":"invalid_api_key"}}Cause: You are sending a raw provider API key (e.g., an OpenAI sk-... or Anthropic sk-ant-... key) instead of a VeriPrompt gateway key.
Fix: Create a VeriPrompt API key in Settings > External API Users. Use the resulting sk-vp-... key in the Authorization header. Your provider keys should be configured separately in Settings > Provider Models.
"Model not available" Error
json
{"error":{"message":"Model 'openai/gpt-4o' is not available.","type":"not_found_error","code":"model_not_found"}}Cause: The specified model is not configured for your company.
Fix: Go to Settings > Provider Models and ensure the model is imported and active. Alternatively, use model: "auto" to let VeriPrompt pick the best available model.
"No active AI providers available" Error
Cause: No provider models are configured, or all provider API keys have decryption issues.
Fix: Check Settings > Provider Models and ensure at least one provider is configured with a valid API key.
Next Steps
- Authentication - API key types, scopes, and setup
- OpenAI-Compatible API - Full compatibility details
- Prompt Management - Create and manage prompts
- Error Handling - Handle errors gracefully
- MCP Server - Advanced tool execution
