API Documentation

Integrate promptHero into your applications with ease.

Authentication & Usage

All API requests must include your API key in the x-api-key header. You can generate an API key from your Dashboard.

Endpoints

POSThttps://prompthero.in/v1/chat/completions

Creates a model response for the given chat conversation (Streamed). We proxy requests to our internal `llm.prompthero.in` models.

Request Example:

curl --location 'https://prompthero.in/v1/chat/completions' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "model": "qwen2.5:14b",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ],
  "stream": true
}'
POSThttps://prompthero.in/api/chat

Standard non-streamed chat completion.

Request Example:

curl --location 'https://prompthero.in/api/chat' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "model": "qwen2.5:14b",
    "messages": [
        {
            "role": "user",
            "content": "Explain quantum computing in one sentence."
        }
    ],
    "stream": false
}'