Skip to main content

Overview

LLMLayer exposes REST endpoints under https://api.llmlayer.dev/api/v2. Authenticate every request with a Bearer token.
Authorization: Bearer YOUR_LLMLAYER_API_KEY
Keep API keys server-side. Do not expose them in browser code.

Endpoints

Answer

/api/v2/answer - web-grounded LLM responses.

Answer Stream

/api/v2/answer_stream - Server-Sent Events for streaming answers.

Web Search

/api/v2/web_search - raw search results.

Scraper

/api/v2/scrape - single-page markdown, HTML, or screenshot extraction.

Extract

/api/v2/extract - structured data, summaries, Q&A, links, and brand profiles.

Map

/api/v2/map - website URL discovery.

Crawl

/api/v2/crawl_stream - streamed markdown pages from a website.

First Request

from llmlayer import LLMLayerClient

client = LLMLayerClient(api_key="YOUR_LLMLAYER_API_KEY")

response = client.answer(
    query="What happened in AI today?",
    model="llmlayer-web",
    search_type="news",
    return_sources=True,
)

print(response.answer)

Field Naming

Raw HTTP request bodies use the field names shown in the OpenAPI schemas. The Python SDK follows Python naming conventions for method arguments, and the TypeScript SDK uses camelCase for many convenience options. Examples:
Raw HTTPPython SDKTypeScript SDK
return_sourcesreturn_sourcesreturnSources
json_schemajson_schemajsonSchema
main_content_onlymain_content_onlymainContentOnly
statusCodestatusCodestatusCode
structured_datastructured_datastructured_data

Errors & Refunds

Shared error format and refund behavior.

Models and Pricing

Supported model IDs and pricing formulas.