Service usage
‘s AI service provides all completion content and grounding sources from frontier AI labs as structured or raw data for use in generative or language engine optimization. The service has a RESTful interface that acceptsGET requests at https:///ai.
Conversations can be localized with geotargeting parameters.
They’re streamed live by default or optionally queued for subsequent
retrieval. Live conversations take an average of several seconds but may require multiple
retries, in which case up to 3 minutes is allocated per API call. Usage
data is published regularly.
Authentication
You can access the service by including your secret API token in anAuthorization header:
Chat parameters
Besides the geotargeting and scheduling parameters linked above, required and optional chat parameters can be added in a standard query string. The keys and values supports are as follows:| Key | Required | Value |
|---|---|---|
prompt | ✅ | The question or instruction of up to 2,047 characters to use as a chat prompt; the prompt requires form or URL encoding (with any space character being replaced by a + character or %20 sequence) |
model | ⬜ | The AI model to chat with, chatgpt, gemini, perplexity (coming soon), or copilot (coming soon); chatgpt is the default model |
device | ⬜ | The name as returned by the devices resource of the device to emulate chatting on (these names are case insensitive but must include form- or URL-encoded spaces and punctuation marks); device emulation is unused by default |
language (planned) | ⬜ | The commonly spelled name or two-letter ISO code of the language to chat in (these names and codes are case insensitive but required to include form- or URL-encoded spaces and punctuation marks); the language is unset by default |
display (planned) | ⬜ | The commonly spelled name or two-letter ISO code of the chat interface’s display language (these names and codes are case insensitive but required to include form- or URL-encoded spaces and punctuation marks); the display language is unset by default or set to the language if given |
format | ⬜ | The format to output to, json, rendered, or raw (see the section below); json is the default format |
expiration | ⬜ | The age in days of when to consider a cached completion expired, where 0 disables caching; 1 is the default number of days before expiration |
Device emulation
Thedevice param lets you fetch a device-specific completion, rather than the default desktop
completion. For a list of supported smartphone and tablet devices, make a request with your API
token and no params to https:///ai/devices:
Response format
Completions are returned as structured JSON, rendered HTML, or raw (unrendered) HTML.JSON
If you set the output to JSON, your completion will be parsed into an object with the geotargeting keys and values above and following chat keys and values:| Key | Value |
|---|---|
model | The AI model that generated the completion |
prompt | The user prompt that the completion was generated for |
html | The rendered HTML of the entire conversation |
promptHtml | The rendered HTML of just the prompt portion of the conversation |
completionHtml | The rendered HTML of just the completion portion of the conversation |
sourcesHtml | The rendered HTML of just the sources portion of the conversation |
queries | An array of the fanout queries that the model searched to generate the completion; only some models expose these queries |
device | The emulated device name that the conversation was had on |
language (planned) | The common name or ISO code of the language that the conversation is in |
display (planned) | The common name or ISO code of the display language that conversation interface is in |
View JSON example
View JSON example

