Quick Start
Send a chat completion request with a single curl command:
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!"}]}'
Supported Models
The API uses model aliases that map to Google Gemini models:
| Alias | Actual Model | Description |
|---|---|---|
lite-2.5 |
gemini-2.5-flash |
High-velocity model for recon, bug bounty automation, and code analysis |
pro-2.5 |
gemini-2.5-pro |
Advanced model for complex pentesting, logic analysis, and exploit chaining |
x-agent |
gemini-2.5-pro |
Specialized agent profile with dedicated x-agent system prompt behavior |
lite-2.5) in your API requests, not the actual model name.
Base URL
https://api.injectprompt.com
Production: https://api.injectprompt.com · Staging: https://staging.api.injectprompt.com
Endpoints
Root — GET /
Simple hello-world endpoint to verify the API is running.
curl https://api.injectprompt.com/
Health — GET /health
Check the health status of the API.
Models — GET /v1/models
Lists all available models with capabilities, context length, and max output tokens.
Chat Completions — POST /v1/chat/completions
OpenAI-compatible chat completions. Requires authentication. Reserves credits before calling the model, then settles actual cost based on token usage.
Billing Balance — GET /v1/billing/balance
Returns the authenticated user's current credit balance. Requires authentication.
Authentication
Protected endpoints require a valid API key in the Authorization 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
Chat Completions
POST /v1/chat/completions
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
model | Yes | string | Model alias (lite-2.5, pro-2.5, x-agent) |
messages | Yes | array | Array of {role, content} (role: user/assistant) |
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 |
Success Response
{
"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. Message roles: system, developer, user, assistant. Client-provided system and developer messages are stripped before the provider call.
Credits and Billing
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 |
x-agent | $1.25 | $10.00 |
Billing flow: (1) Credits reserved before each request; (2) Actual cost settled after response; (3) If provider fails, reservation released. Use request_id for idempotency — retries with the same ID are not double-charged.
Error Handling
All errors follow the OpenAI error response format:
{
"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)
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)
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);
base_url and api_key.