Home/APIs/Answer
Most Popular API

Answer
API

AI-powered answers with real-time web search and source citations. Simple, predictable pricing.

llmlayer-web
$0.006
per request, flat. Finetuned GPT-4o-mini for web answers.
llmlayer-fast
$0.009
per request, flat. Fast finetuned GPT-OSS-120B for web search & answers.
Flat pricingCitations includedStreaming
Advanced
Choose from 4 models
$0.004
+ token costs
How It Works

Four Steps to Answers

01
Search Web

Query the web for relevant sources

02
Read Sources

Extract content from top results

03
Generate

AI creates comprehensive response

04
Cite

Return answer with verifiable citations

Pricing Options

Two Pricing Models

Use llmlayer-fast for fast answers or llmlayer-web for flat pricing, or choose any other model.

llmlayer-fast
$0.009
per request, flat — fast finetuned GPT-OSS-120B
llmlayer-web
$0.006
per request, flat — finetuned GPT-4o-mini
Predictable costs
No token calculation
Best for most use cases
Streaming supported
# Flat $0.009 per request — fast answers
response = client.answer(
query="Your question",
model="llmlayer-fast"
)
Advanced
$0.004
+ token costs per model
Choose from 3 OpenAI models
Fine-tune with temperature
Custom system prompts
Token-based pricing
# Choose your model
response = client.answer(
query="Your question",
model="openai/gpt-5.1"
)
Code Examples

Quick Start

main.py
PYTHON
from llmlayer import LLMLayerClient

client = LLMLayerClient(api_key="...")

# Flat $0.006 per request
response = client.answer(
    query="What is quantum computing?",
    model="llmlayer-web",  # Required
    citations=True
)

print(response.answer)
print(f"Sources: {len(response.sources)}")
index.ts
TYPESCRIPT
import { LLMLayerClient } from 'llmlayer';

const client = new LLMLayerClient({
  apiKey: process.env.LLMLAYER_API_KEY
});

// Streaming - $0.006 flat
const stream = client.streamAnswer({
  query: 'Explain machine learning',
  model: 'llmlayer-web'  // Required
});

for await (const chunk of stream) {
  process.stdout.write(chunk.content);
}
TerminalcURL
curl -X POST https://api.llmlayer.dev/api/v2/answer \
  -H "Authorization: Bearer $LLMLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "What is the capital of France?", "model": "llmlayer-web", "citations": true}'
Available Models

5 Models Available

PROVIDER
MODEL
PRICING
BEST FOR
LLMLayer
llmlayer-fast
$0.009 flat— fast answers
Fast finetuned GPT-OSS-120B for web search & answers
LLMLayer
llmlayer-web
$0.006 flat— no token math
Finetuned GPT-4o-mini for web answers
Advanced Models
$0.004 + token costs
PROVIDER
MODEL
INPUT
OUTPUT
BEST FOR
OpenAI
gpt-5.1
$1.25/M
$10.00/M
Most capable
OpenAI
gpt-4.1
$2.00/M
$8.00/M
High performance
OpenAI
gpt-4o-mini
$0.15/M
$0.60/M
Fast & affordable

Token prices are per 1 million tokens. Use model parameter: provider/model-name (e.g., openai/gpt-5.1)

Features

Built for Developers

Streaming

Real-time SSE streaming for chat interfaces

JSON Output

Structured responses with custom schemas

Citations

Inline [1] markers with source links

Pay Per Use

Simple pricing, no hidden costs

System Prompts

Custom instructions for tone and format

Multi-Query

Run multiple searches for deeper research

$0.006per request

Start Building
Today

Get your API key and start generating AI answers with citations. Free to start. No subscriptions.