Skip to content

Quick Start Guide ​

Get up and running with Veriprompt in 5 minutes. This guide will walk you through making your first API call and seeing Veriprompt in action.

Step 1: Get Your API Key ​

Option A: Using Our Cloud Service ​

  1. Sign up at veriprompt.com
  2. Navigate to Developer Portal in your dashboard
  3. Click "Generate API Key"
  4. Copy your API key (starts with vp_)

Option B: Self-Hosted ​

If you're running Veriprompt on your own infrastructure:

  1. Log in to your Veriprompt instance
  2. Navigate to Settings → API Keys
  3. Generate a new API key
  4. Copy and store it securely

Keep Your API Key Secret

Never commit API keys to version control or share them publicly. Store them as environment variables.

Step 2: Make Your First API Call ​

Choose your preferred language:

bash
curl -X POST https://app.veriprompt.tech/api/gateway/execute \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "prompt": "Explain quantum computing in simple terms",
    "provider": "auto",
    "maxTokens": 150
  }'
javascript
// Install: npm install @veriprompt/sdk
import { VeripromptClient } from '@veriprompt/sdk';

const client = new VeripromptClient({
  apiKey: process.env.VERIPROMPT_API_KEY
});

async function runPrompt() {
  const response = await client.execute({
    prompt: 'Explain quantum computing in simple terms',
    provider: 'auto', // Let Veriprompt choose the best provider
    maxTokens: 150
  });

  console.log(response.text);
  console.log(`Used provider: ${response.provider}`);
  console.log(`Cost: $${response.cost}`);
}

runPrompt();
python
# Install: pip install veriprompt
from veriprompt import VeripromptClient

client = VeripromptClient(api_key="YOUR_API_KEY")

response = client.execute(
    prompt="Explain quantum computing in simple terms",
    provider="auto",  # Let Veriprompt choose the best provider
    max_tokens=150
)

print(response.text)
print(f"Used provider: {response.provider}")
print(f"Cost: ${response.cost}")

Pro Tip

Use provider: "auto" to let Veriprompt's intelligent routing choose the optimal provider based on cost, performance, and quality!

Step 3: Understand the Response ​

You'll receive a response like this:

json
{
  "text": "Quantum computing harnesses quantum mechanics to process information in fundamentally new ways...",
  "provider": "anthropic",
  "model": "claude-3-sonnet",
  "tokens": {
    "prompt": 8,
    "completion": 142,
    "total": 150
  },
  "cost": 0.0012,
  "latency": 1234,
  "requestId": "req_abc123xyz",
  "timestamp": "2024-11-10T10:30:00Z"
}

Key Response Fields ​

FieldDescription
textThe AI-generated response
providerWhich AI provider was used (e.g., anthropic, openai)
modelThe specific model used
tokensToken usage breakdown
costActual cost in USD for this request
latencyResponse time in milliseconds
requestIdUnique ID for tracking and debugging

Step 4: Add Security Scanning ​

Protect against prompt injection attacks with built-in security:

javascript
const response = await client.execute({
  prompt: userInput, // User-provided input
  provider: 'auto',
  security: {
    scanInjection: true,      // Detect injection attempts
    blockOnThreat: true,       // Block if threats detected
    minThreatScore: 0.7       // Threat threshold (0-1)
  }
});

if (response.security.threatsDetected) {
  console.error('Security threat detected:', response.security.threats);
  // Handle the threat appropriately
} else {
  console.log(response.text);
}
python
response = client.execute(
    prompt=user_input,  # User-provided input
    provider="auto",
    security={
        "scan_injection": True,      # Detect injection attempts
        "block_on_threat": True,     # Block if threats detected
        "min_threat_score": 0.7      # Threat threshold (0-1)
    }
)

if response.security.threats_detected:
    print("Security threat detected:", response.security.threats)
    # Handle the threat appropriately
else:
    print(response.text)
bash
curl -X POST https://app.veriprompt.tech/api/gateway/execute \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "prompt": "User input here",
    "provider": "auto",
    "security": {
      "scanInjection": true,
      "blockOnThreat": true,
      "minThreatScore": 0.7
    }
  }'

Step 5: Optimize for Cost ​

Route to the most cost-effective provider:

javascript
const response = await client.execute({
  prompt: 'Summarize this article...',
  routing: {
    strategy: 'cost-optimized',   // Prioritize lowest cost
    maxCost: 0.001,               // Max cost per request
    minQuality: 80                // Minimum quality score (0-100)
  }
});

console.log(`Saved money! Used ${response.provider} at $${response.cost}`);
python
response = client.execute(
    prompt="Summarize this article...",
    routing={
        "strategy": "cost-optimized",  # Prioritize lowest cost
        "max_cost": 0.001,            # Max cost per request
        "min_quality": 80             # Minimum quality score (0-100)
    }
)

print(f"Saved money! Used {response.provider} at ${response.cost}")

Result: Veriprompt automatically routes to providers like DeepSeek or smaller models when appropriate, saving you money without sacrificing quality.

Step 6: Use Stored Prompts ​

Store prompts in the repository for versioning and reuse:

Create a Prompt in the UI ​

  1. Navigate to Prompt Repository
  2. Click "New Prompt"
  3. Enter prompt details:
    • ID: welcome-message
    • System Prompt: You are a friendly customer service assistant
    • User Prompt: Greet the customer and ask how you can help
  4. Click Save

Execute the Stored Prompt ​

javascript
const response = await client.executePrompt({
  promptId: 'welcome-message',
  variables: {
    customerName: 'John'
  }
});
python
response = client.execute_prompt(
    prompt_id="welcome-message",
    variables={
        "customer_name": "John"
    }
)
bash
curl -X POST https://app.veriprompt.tech/api/gateway/execute \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "promptId": "welcome-message",
    "variables": {
      "customerName": "John"
    }
  }'

Common Use Cases ​

1. Customer Support Chatbot ​

javascript
async function handleCustomerQuery(userMessage, conversationHistory) {
  const response = await client.execute({
    prompt: userMessage,
    context: conversationHistory,
    routing: {
      strategy: 'balanced',  // Balance cost and quality
      maxLatency: 2000       // Max 2 second response
    },
    security: {
      scanInjection: true    // Protect against prompt injection
    }
  });

  return response.text;
}

2. Content Generation ​

javascript
async function generateBlogPost(topic, tone) {
  const response = await client.execute({
    prompt: `Write a blog post about ${topic} in a ${tone} tone`,
    routing: {
      strategy: 'quality-first',  // Prioritize quality
      minQuality: 90
    },
    maxTokens: 1000
  });

  return response.text;
}

3. Data Analysis ​

javascript
async function analyzeData(csvData) {
  const response = await client.execute({
    prompt: `Analyze this data and provide insights: ${csvData}`,
    provider: 'claude-3-opus',  // Use specific high-capability model
    attachments: [{
      type: 'text/csv',
      content: csvData
    }]
  });

  return response.text;
}

Next Steps ​

🔐 Authentication

Learn about API keys, OAuth, and security best practices

Learn more →

📚 API Reference

Complete endpoint documentation with all parameters

Explore API →

🎯 Routing Strategies

Master intelligent routing for cost and performance

Deep dive →

🔒 Security Features

Protect your application from prompt injection and more

Security guide →

Troubleshooting ​

"Unauthorized" Error ​

Make sure your API key is:

  • Valid and not expired
  • Included in the Authorization: Bearer header
  • Not accidentally shared or committed to GitHub

"Rate Limited" Error ​

You've exceeded your tier's rate limit. Solutions:

  • Implement exponential backoff
  • Upgrade your tier
  • Use caching for repeated requests

"Provider Unavailable" Error ​

The selected provider is temporarily down. Solutions:

  • Use provider: "auto" for automatic failover
  • Configure fallback providers in routing policy
  • Check status.veriprompt.com

View Complete Troubleshooting Guide →

Get Help ​


Congratulations! 🎉 You've made your first API call with Veriprompt. Ready to build something amazing?

Explore User Guides → | View API Reference → | Read FAQ →