Skip to main content

Quickstart Guide

Get up and running with Perf in under 5 minutes.

Prerequisites

  • An account at withperf.pro
  • Your API key (available in the dashboard)
  • Basic knowledge of REST APIs

Step 1: Get Your API Key

  1. Sign up at dashboard.withperf.pro/sign-up
  2. Navigate to SettingsAPI Keys
  3. Click Generate New Key
  4. Copy your key (format: pk_live_... for production, pk_test_... for testing)
Important: Store your API key securely. Never commit it to version control.

Step 2: Make Your First Request

Using cURL

Response

The response is OpenAI-compatible:

Step 3: Add Cost Controls

Control costs by setting a budget per request:
Perf will automatically select a model that stays within your budget. If the optimal model exceeds your limit, we’ll use the best alternative and include a cost warning in the response.

Step 4: Use Streaming for Real-Time Responses

For chat applications, use streaming to show responses as they’re generated:
The response uses OpenAI-compatible Server-Sent Events (SSE) format:

Step 5: View Your Analytics

Analytics are available via the API. Dashboard features are coming soon. Use the Metrics API to:
  • View total requests and costs
  • Analyze model distribution
  • Track latency metrics
  • Export usage data

Language-Specific Examples

Python

JavaScript/TypeScript

Go

Common Use Cases

Task-Specific Optimization

Perf automatically detects your task type and selects the optimal model:

Multi-Turn Conversations

Structured Output

Perf automatically detects extraction tasks and routes to models that excel at structured output. Simply ask for JSON in your prompt:

Rate Limits

  • Free Tier: 1,000 requests/month, 60 requests/minute
  • Pro Tier: 100,000 requests/month, 300 requests/minute
  • Enterprise: Custom limits
When you exceed rate limits, you’ll receive a 429 Too Many Requests response with a Retry-After header.

Error Handling

Next Steps

Need Help?