Quick Start

Send a chat completion request with a single command:

bash
curl -X POST https://api.injectprompt.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"model": "lite-2.5", "messages": [{"role": "user", "content": "Hello!"}]}'

Models

Explore available models and compare their capabilities.

Featured models
Model alias Description
lite-2.5 High-velocity model for recon, bug bounty automation, and code analysis
pro-2.5 Advanced model for complex pentesting, logic analysis, and exploit chaining
lite-3.0 Fast 3.0-tier alias for automation, recon, and code analysis
pro-3.0 Advanced 3.0-tier alias for deep reasoning, pentesting, and exploit chaining

Pricing

1 credit = $1 USD. Credits are purchased through the InjectPrompt Platform via Stripe.

Pricing (per 1M tokens)

Model Input Output
lite-2.5 $0.30 $2.50
pro-2.5 $1.25 $10.00
lite-3.0 $0.30 $2.50
pro-3.0 $1.25 $10.00
💡 Billing flow: Credits are reserved before each request. Actual cost is settled after the response using real token counts. If the provider fails, the reservation is released. Use request_id for idempotency — retries with the same ID are never double-charged.

Base URL

url
https://api.injectprompt.com

Production: https://api.injectprompt.com · Staging: https://staging.api.injectprompt.com

Authentication

Protected endpoints require a valid API key in the Authorization header:

header
Authorization: Bearer sk_live_your_api_key_here

API keys are generated through the InjectPrompt Platform dashboard. Each key is hashed (SHA-256) and stored securely — the plaintext is shown only once on creation.

Protected: /v1/chat/completions, /v1/billing/balance  ·  Public: /, /health, /v1/models

Endpoints

GET
/
Hello-world endpoint to verify the API is running
GET
/health
Check API health status
GET
/v1/models
List all available models with capabilities, context length, and max output tokens
POST
/v1/chat/completions
OpenAI-compatible chat completions. Requires authentication. Reserves credits before calling the model, then settles actual cost based on token usage.
GET
/v1/billing/balance
Returns the authenticated user's current credit balance. Requires authentication.

Chat Completions

POST /v1/chat/completions

Parameters

Parameter Required Type Description
model Yes string Model alias (lite-2.5, pro-2.5, lite-3.0, pro-3.0)
messages Yes array Array of {role, content} objects
temperature No number Sampling temperature (0–2)
max_tokens No integer Max tokens to generate (hard cap: 65535)
stream No boolean Enable SSE streaming when true
request_id No string Client idempotency key for billing deduplication

Response

json
{
  "id": "chatcmpl_a1b2c3d4...",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "lite-2.5",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! How can I help you today?"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 20,
    "total_tokens": 30
  }
}

System prompt is injected automatically based on model. Client-provided system and developer role messages are stripped before the provider call.

Error Handling

All errors follow the OpenAI error response format:

json
{
  "error": {
    "message": "Error description",
    "type": "error_type",
    "param": null,
    "code": "error_code"
  }
}
Status Error Type Description
400 invalid_request_error Invalid request format or parameters
401 authentication_error Missing, invalid, revoked, or expired API key
402 insufficient_quota Not enough credits
429 rate_limit_error Rate limit exceeded — check Retry-After header
500 server_error Upstream provider error

Code Examples

Python (OpenAI SDK)

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.injectprompt.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="lite-2.5",
    messages=[{"role": "user", "content": "Hello!"}],
    temperature=0.7,
    max_tokens=150
)
print(response.choices[0].message.content)

JavaScript (OpenAI SDK)

javascript
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.injectprompt.com/v1',
  apiKey: 'YOUR_API_KEY'
});

const response = await client.chat.completions.create({
  model: 'lite-2.5',
  messages: [{ role: 'user', content: 'Hello!' }],
  temperature: 0.7,
  max_tokens: 150
});

console.log(response.choices[0].message.content);
ℹ️ This API is fully OpenAI-compatible. Use the OpenAI Python SDK or Node SDK with your base_url and api_key.