Gateway
The AI Runtime Control gateway forwards your requests to AI model providers. You authenticate to the gateway with a virtual key, and the gateway uses the credentials configured on that key to reach the provider for you. Most gateway endpoints accept the same requests and return the same responses as the provider APIs OpenAI Chat Completions, OpenAI Responses APIs, Anthropic Messages API, and Amazon Bedrock Runtime InvokeModel and InvokeModelWithResponseStream APIs. This means you can keep using your existing provider client and change only its base URL and credentials. Specify models by name, for example gpt-4 or claude-sonnet-4-20250514. Bedrock endpoints work differently. They put the Bedrock model ID or ARN in the request path instead of a model field, and authenticate with a Bearer token instead of signing requests with AWS Signature Version 4 (SigV4). Each endpoint follows its provider's request and response format, so see that provider's documentation for the full list of supported fields.
IMPORTANT: Unlike other Fastly APIs, the base URL for Gateway is https://arc.fastly.app.
Data model
error | object | ||
messages | array | The conversation so far. | |
model | string | The model to use, addressed by its bare model name. The provider is determined by the virtual key's configured provider. Failover targets are only tried if that primary request fails. | |
stream | boolean | Whether to stream the response as server-sent events. [Default false] | |
choices | array | ||
input_tokens | integer | The number of input tokens the request would consume. | |
max_tokens | integer | The maximum number of tokens to generate. | |
input | string | The text to synthesize into speech. | |
speed | number | The speech speed multiplier. | |
voice | string | The voice to use. | |
file | string | The audio file to transcribe (up to 25 MB). | |
language | string | The language of the audio, as an ISO 639-1 code. | |
text | string | The transcribed text. |