Quick Start

Send a chat completion request with a single curl 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!"}]}'

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
ℹ️ Always use the alias (e.g. lite-2.5) in your API requests, not the actual model name.

Base URL

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.

bash
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:

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
modelYesstringModel alias (lite-2.5, pro-2.5, x-agent)
messagesYesarrayArray of {role, content} (role: user/assistant)
temperatureNonumberSampling temperature (0–2)
max_tokensNointegerMax tokens to generate (hard cap: 65535)
streamNobooleanEnable SSE streaming when true
request_idNostringClient idempotency key for billing deduplication

Success 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. 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:

json
{
  "error": {
    "message": "Error description",
    "type": "error_type",
    "param": null,
    "code": "error_code"
  }
}
Status Error Type Description
400invalid_request_errorInvalid request format or parameters
401authentication_errorMissing, invalid, revoked, or expired API key
402insufficient_quotaNot enough credits
429rate_limit_errorRate limit exceeded — check Retry-After header
500server_errorUpstream 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 OpenAI-compatible — use the OpenAI Python SDK or OpenAI Node SDK with base_url and api_key.