> For the complete documentation index, see [llms.txt](https://docs.fastrouter.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastrouter.ai/api-reference/gemini-interactions-api-format.md).

# Gemini Interactions API Format

## Create Interaction

> Creates a Gemini interaction and returns the completed result.\
> \
> \*\*Behavior\*\*\
> \- Synchronous: the HTTP call waits until the interaction finishes (including video generation, which can take minutes).\
> \- Optional \`stream: true\` returns Server-Sent Events while the interaction runs, then ends when complete.\
> \- FastRouter rewrites catalogue model ids to bare Google ids, maps \`previous\_interaction\_id\` for sticky continuity, injects \`usage.cost\` / \`usage.chat\_id\`, and returns a client-facing \`fr\_…\` id.\
> \- Alias path: \`/api/v1/interactions\`.\
> \
> \*\*Modalities\*\*\
> \- Text / tools as usual.\
> \- Video generation & conversational editing via models such as \`google/gemini-omni-flash-preview\` (see \`response\_modalities\`, \`response\_format\`, and \`generation\_config.video\_config\`).\
> \- Video tokens appear in \`usage.output\_tokens\_by\_modality\` and are billed at the catalogue video rate.\
> \
> \*\*Router-only fields\*\* (stripped before upstream): \`provider\`, \`request\_tags\`.

```json
{"openapi":"3.1.0","info":{"title":"FastRouter API Reference","version":"1.0.0"},"tags":[{"name":"Interactions","description":"Google Gemini Interactions API (successor to generateContent). FastRouter forwards to Google AI Studio with routing, sticky `previous_interaction_id`, credits billing, and client-facing `fr_…` ids. Supports text, image, audio, and video (including Gemini Omni Flash conversational video). Create requests always run to completion before the HTTP response returns (use `stream: true` for SSE deltas while waiting)."}],"servers":[{"url":"https://api.fastrouter.ai","description":"Production API"}],"security":[{"bearerAuth":[]},{"keyQuery":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"FastRouter API Key. Get yours at https://fastrouter.ai\n\nFormat: `Authorization: Bearer YOUR_API_KEY`"},"keyQuery":{"type":"apiKey","in":"query","name":"key","description":"FastRouter API Key (Gemini style). Get yours at https://fastrouter.ai\n\nFormat: `?key=YOUR_API_KEY`"}},"schemas":{"CreateInteractionRequest":{"type":"object","required":["model","input"],"description":"Create Interaction request. Provide `model` (required) plus `input`. The model must exist in the FastRouter catalogue. Native Google Interactions fields are forwarded to Google AI Studio after FastRouter rewrites `model` / `previous_interaction_id` and strips router-only fields (`provider`, `request_tags`). Supports multimodal input (text, image, audio, video) and video models such as `google/gemini-omni-flash-preview` when listed in the catalogue.","properties":{"model":{"type":"string","description":"Model to use. Must be a FastRouter catalogue id (e.g. google/gemini-3.5-flash) or bare Google id that resolves in the catalogue. Unknown models return 400."},"input":{"description":"Interaction input: plain string, Content, or an array of Content / Step / Turn objects (e.g. `user_input` with nested content). For video models, string prompts generate video; arrays can include text plus image/video (base64 `data` + `mime_type`, or `uri`) for image-to-video, video-to-video / reference, or edit flows.","oneOf":[{"type":"string","description":"Simple text input"},{"type":"array","description":"Multimodal content, steps, or turns","items":{}},{"type":"object","description":"Single Content object"}]},"previous_interaction_id":{"type":"string","description":"Continue a prior interaction. Pass the `fr_…` id returned by FastRouter (preferred) or an upstream id. Used for sticky routing / BYOK pin and rewritten to the provider-native id upstream."},"system_instruction":{"type":"string","description":"System instruction for this interaction (interaction-scoped; re-send each turn)."},"tools":{"type":"array","description":"Tool declarations the model may call (e.g. google_search, function calling).","items":{"type":"object"}},"response_format":{"description":"Output format constraints. For video generation use type=video with optional aspect_ratio and delivery. Use delivery=inline so video is returned as base64 in the response (accessible via FastRouter without a Google API key).","oneOf":[{"$ref":"#/components/schemas/InteractionsVideoResponseFormat"},{"type":"object","description":"Other Google response_format variants (text / image / audio / JSON schema)."},{"type":"array","items":{"type":"object"},"description":"Array of response format objects when supported."}]},"stream":{"type":"boolean","default":false,"description":"When true, FastRouter streams Server-Sent Events while the interaction runs. The request still completes in this same call (not a separate async job)."},"store":{"type":"boolean","default":true,"description":"Whether Google should store the interaction for later GET / `previous_interaction_id`. Defaults to true."},"generation_config":{"$ref":"#/components/schemas/InteractionsGenerationConfig"},"response_modalities":{"type":"array","description":"Requested response modalities. Include video for Omni / video-generation models.","items":{"type":"string","enum":["text","image","audio","video","document"]}},"safety_settings":{"type":"array","description":"Safety settings for the interaction.","items":{"type":"object"}},"service_tier":{"type":"string","enum":["flex","standard","priority"],"description":"Service tier for the interaction. Forwarded upstream (unlike provider / request_tags)."},"environment":{"description":"Environment configuration or existing environment id.","oneOf":[{"type":"string"},{"type":"object"}]},"labels":{"type":"object","additionalProperties":{"type":"string"},"description":"User-defined metadata labels."},"provider":{"type":"object","description":"Optional FastRouter routing controls. Interactions currently only supports googleaistudio; provider.only that excludes googleaistudio is rejected. Stripped before forwarding upstream.","properties":{"only":{"type":"array","description":"Force routing to specific providers only. Request will only use providers in this list. Use when you need guaranteed provider selection.","items":{"type":"string"},"minItems":1},"order":{"type":"array","description":"Ordered list of providers to try in sequence. FastRouter attempts each provider in order. Use with allow_fallbacks for high-availability routing.","items":{"type":"string"},"minItems":1},"allow_fallbacks":{"type":"boolean","description":"When used with 'order', enables automatic fallback to the next provider in the list if the current provider is unavailable. Set to true for high-availability routing.","default":true}}},"request_tags":{"type":"array","items":{"type":"string"},"description":"Optional FastRouter tags for logging/analytics. Stripped before forwarding upstream."}}},"InteractionsVideoResponseFormat":{"type":"object","description":"Video output format (response_format when type=video).","required":["type"],"properties":{"type":{"type":"string","enum":["video"],"description":"Must be video."},"aspect_ratio":{"type":"string","enum":["16:9","9:16"],"description":"Aspect ratio for the video output."},"delivery":{"type":"string","enum":["inline","uri"],"description":"`inline` returns base64 in the response (recommended for FastRouter clients). `uri` returns a Google-hosted URI that requires a Google API key to download."},"duration":{"type":"string","description":"Optional duration for the video output (model-dependent)."},"gcs_uri":{"type":"string","description":"Optional GCS URI for video output when using URI delivery (provider-dependent)."}}},"InteractionsGenerationConfig":{"type":"object","description":"Model configuration (`generation_config`). Only applicable when `model` is set. For video models, optionally set `video_config.task` (`text_to_video` | `image_to_video` | `reference_to_video` | `edit`).","properties":{"max_output_tokens":{"type":"integer","description":"Maximum number of tokens to include in the response."},"temperature":{"type":"number","description":"Sampling temperature."},"top_p":{"type":"number","description":"Nucleus sampling parameter."},"seed":{"type":"integer","description":"Seed used in decoding for reproducibility."},"stop_sequences":{"type":"array","items":{"type":"string"},"description":"Character sequences that stop generation."},"thinking_level":{"type":"string","enum":["minimal","low","medium","high"],"description":"Level of thought tokens the model should generate."},"thinking_summaries":{"type":"string","enum":["auto","none"],"description":"Whether to include thought summaries in the response."},"tool_choice":{"description":"Tool choice configuration (string enum or object).","oneOf":[{"type":"string","enum":["auto","any","none","validated"]},{"type":"object"}]},"speech_config":{"type":"array","description":"Configuration for speech interaction.","items":{"type":"object"}},"transcription_config":{"type":"object","description":"Optional speech recognition (transcription) configuration."},"video_config":{"$ref":"#/components/schemas/InteractionsVideoConfig"}}},"InteractionsVideoConfig":{"type":"object","description":"Video generation options (`generation_config.video_config`). Used by video models such as `gemini-omni-flash-preview`. If `task` is omitted, the model infers it from input.","properties":{"task":{"type":"string","description":"Optional video task mode. If omitted, the model infers mode from the prompt and input media.","enum":["text_to_video","image_to_video","reference_to_video","edit"]}}},"Interaction":{"type":"object","description":"Completed interaction resource. FastRouter rewrites `id` to a client-facing `fr_…` value and echoes `previous_interaction_id` when continuing a conversation.","properties":{"id":{"type":"string","description":"Client-facing interaction id (`fr_…`). Pass this as `previous_interaction_id` to continue."},"object":{"type":"string"},"status":{"type":"string","description":"Interaction status. Successful creates return `completed`."},"model":{"type":"string","description":"Upstream model id used for the interaction."},"created":{"type":"string","format":"date-time","description":"Creation timestamp."},"updated":{"type":"string","format":"date-time","description":"Last update timestamp."},"previous_interaction_id":{"type":"string","description":"Previous interaction id as sent by the client (fr_… when continuing)."},"steps":{"type":"array","description":"Execution steps (model_output, tool calls/results, etc.).","items":{"type":"object"}},"usage":{"$ref":"#/components/schemas/InteractionsUsage"},"outputs":{"type":"array","description":"Convenience output payloads when present (may include video content blocks).","items":{"type":"object"}},"output_video":{"type":"object","description":"Convenience video payload when present. On raw REST, video usually appears under `steps[].content` (e.g. type `video` with `uri` or `data`).","properties":{"type":{"type":"string"},"data":{"type":"string","description":"Base64 video bytes when delivery=inline."},"uri":{"type":"string","description":"Video URI when delivery=uri."},"mime_type":{"type":"string"}}}}},"InteractionsUsage":{"type":"object","description":"Token usage for the interaction. FastRouter injects `cost` and `chat_id`. For video/image outputs, see `output_tokens_by_modality` — video tokens are billed at the catalogue video rate.","properties":{"total_input_tokens":{"type":"integer"},"total_output_tokens":{"type":"integer"},"total_thought_tokens":{"type":"integer"},"total_cached_tokens":{"type":"integer"},"total_tool_use_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"input_tokens_by_modality":{"type":"array","description":"Input token breakdown by modality.","items":{"$ref":"#/components/schemas/InteractionsModalityTokens"}},"cost":{"type":"number","description":"Credits consumed for this request (FastRouter-injected)."},"chat_id":{"type":"string","description":"FastRouter client-facing interaction id (fr_…), injected into usage."},"service_tier":{"type":"string","description":"Applied service tier when present."},"output_tokens_by_modality":{"type":"array","description":"Output token breakdown by modality (e.g. text vs video). FastRouter uses the video entry for video billing.","items":{"$ref":"#/components/schemas/InteractionsModalityTokens"}},"cached_tokens_by_modality":{"type":"array","description":"Cached token breakdown by modality.","items":{"$ref":"#/components/schemas/InteractionsModalityTokens"}},"tool_use_tokens_by_modality":{"type":"array","description":"Tool-use token breakdown by modality.","items":{"$ref":"#/components/schemas/InteractionsModalityTokens"}},"grounding_tool_count":{"description":"Grounding tool usage counts (e.g. google_search). Used for web-search billing when present.","oneOf":[{"type":"object"},{"type":"array","items":{"type":"object"}}]}}},"InteractionsModalityTokens":{"type":"object","description":"Token count for a single modality (text, image, audio, video, document).","properties":{"modality":{"type":"string","description":"Response/input modality.","enum":["text","image","audio","video","document"]},"tokens":{"type":"integer","description":"Number of tokens for this modality."}}},"InteractionsError":{"type":"object","description":"Gemini-shaped error envelope returned by the Interactions surface.","properties":{"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"status":{"type":"string","description":"Google-style status string (e.g. INVALID_ARGUMENT, RESOURCE_EXHAUSTED, PROVIDER_ERROR)."}},"required":["code","message","status"]}}}},"responses":{"UnauthorizedError":{"description":"Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.\n\nNote: the 401 error body uses `code`, `message`, `param`, and `type` (there is no `status` field), and `type` is `invalid_request_error`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"InsufficientCreditsError":{"description":"Insufficient Credits - Your account or API key has run out of credits. Add more credits and retry the request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}},"RateLimitError":{"description":"Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}},"InternalServerError":{"description":"Internal Error - Something went wrong on our side. Retry the request, and contact support if the issue persists.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}}}},"paths":{"/v1/interactions":{"post":{"operationId":"createInteraction","tags":["Interactions"],"summary":"Create Interaction","description":"Creates a Gemini interaction and returns the completed result.\n\n**Behavior**\n- Synchronous: the HTTP call waits until the interaction finishes (including video generation, which can take minutes).\n- Optional `stream: true` returns Server-Sent Events while the interaction runs, then ends when complete.\n- FastRouter rewrites catalogue model ids to bare Google ids, maps `previous_interaction_id` for sticky continuity, injects `usage.cost` / `usage.chat_id`, and returns a client-facing `fr_…` id.\n- Alias path: `/api/v1/interactions`.\n\n**Modalities**\n- Text / tools as usual.\n- Video generation & conversational editing via models such as `google/gemini-omni-flash-preview` (see `response_modalities`, `response_format`, and `generation_config.video_config`).\n- Video tokens appear in `usage.output_tokens_by_modality` and are billed at the catalogue video rate.\n\n**Router-only fields** (stripped before upstream): `provider`, `request_tags`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInteractionRequest"}}}},"responses":{"200":{"description":"Completed interaction. When `stream=true`, body is an SSE stream that ends with the completed interaction. `id` is FastRouter `fr_…`; `usage` includes `cost`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Interaction"}},"text/event-stream":{"schema":{"type":"string","description":"SSE events with partial interaction / deltas."}}}},"400":{"description":"Bad request (missing/invalid model, invalid previous_interaction_id, unsupported provider.only, etc.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionsError"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"402":{"$ref":"#/components/responses/InsufficientCreditsError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"description":"Upstream / routing failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionsError"}}}}}}}}}
```

## Get Interaction

> Retrieves a previously stored interaction by FastRouter \`fr\_…\` id (or upstream id). Use the returned \`id\` with \`previous\_interaction\_id\` on a later create to continue the conversation (e.g. Omni video edits). Alias: \`/api/v1/interactions/{id}\`.

```json
{"openapi":"3.1.0","info":{"title":"FastRouter API Reference","version":"1.0.0"},"tags":[{"name":"Interactions","description":"Google Gemini Interactions API (successor to generateContent). FastRouter forwards to Google AI Studio with routing, sticky `previous_interaction_id`, credits billing, and client-facing `fr_…` ids. Supports text, image, audio, and video (including Gemini Omni Flash conversational video). Create requests always run to completion before the HTTP response returns (use `stream: true` for SSE deltas while waiting)."}],"servers":[{"url":"https://api.fastrouter.ai","description":"Production API"}],"security":[{"bearerAuth":[]},{"keyQuery":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"FastRouter API Key. Get yours at https://fastrouter.ai\n\nFormat: `Authorization: Bearer YOUR_API_KEY`"},"keyQuery":{"type":"apiKey","in":"query","name":"key","description":"FastRouter API Key (Gemini style). Get yours at https://fastrouter.ai\n\nFormat: `?key=YOUR_API_KEY`"}},"schemas":{"Interaction":{"type":"object","description":"Completed interaction resource. FastRouter rewrites `id` to a client-facing `fr_…` value and echoes `previous_interaction_id` when continuing a conversation.","properties":{"id":{"type":"string","description":"Client-facing interaction id (`fr_…`). Pass this as `previous_interaction_id` to continue."},"object":{"type":"string"},"status":{"type":"string","description":"Interaction status. Successful creates return `completed`."},"model":{"type":"string","description":"Upstream model id used for the interaction."},"created":{"type":"string","format":"date-time","description":"Creation timestamp."},"updated":{"type":"string","format":"date-time","description":"Last update timestamp."},"previous_interaction_id":{"type":"string","description":"Previous interaction id as sent by the client (fr_… when continuing)."},"steps":{"type":"array","description":"Execution steps (model_output, tool calls/results, etc.).","items":{"type":"object"}},"usage":{"$ref":"#/components/schemas/InteractionsUsage"},"outputs":{"type":"array","description":"Convenience output payloads when present (may include video content blocks).","items":{"type":"object"}},"output_video":{"type":"object","description":"Convenience video payload when present. On raw REST, video usually appears under `steps[].content` (e.g. type `video` with `uri` or `data`).","properties":{"type":{"type":"string"},"data":{"type":"string","description":"Base64 video bytes when delivery=inline."},"uri":{"type":"string","description":"Video URI when delivery=uri."},"mime_type":{"type":"string"}}}}},"InteractionsUsage":{"type":"object","description":"Token usage for the interaction. FastRouter injects `cost` and `chat_id`. For video/image outputs, see `output_tokens_by_modality` — video tokens are billed at the catalogue video rate.","properties":{"total_input_tokens":{"type":"integer"},"total_output_tokens":{"type":"integer"},"total_thought_tokens":{"type":"integer"},"total_cached_tokens":{"type":"integer"},"total_tool_use_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"input_tokens_by_modality":{"type":"array","description":"Input token breakdown by modality.","items":{"$ref":"#/components/schemas/InteractionsModalityTokens"}},"cost":{"type":"number","description":"Credits consumed for this request (FastRouter-injected)."},"chat_id":{"type":"string","description":"FastRouter client-facing interaction id (fr_…), injected into usage."},"service_tier":{"type":"string","description":"Applied service tier when present."},"output_tokens_by_modality":{"type":"array","description":"Output token breakdown by modality (e.g. text vs video). FastRouter uses the video entry for video billing.","items":{"$ref":"#/components/schemas/InteractionsModalityTokens"}},"cached_tokens_by_modality":{"type":"array","description":"Cached token breakdown by modality.","items":{"$ref":"#/components/schemas/InteractionsModalityTokens"}},"tool_use_tokens_by_modality":{"type":"array","description":"Tool-use token breakdown by modality.","items":{"$ref":"#/components/schemas/InteractionsModalityTokens"}},"grounding_tool_count":{"description":"Grounding tool usage counts (e.g. google_search). Used for web-search billing when present.","oneOf":[{"type":"object"},{"type":"array","items":{"type":"object"}}]}}},"InteractionsModalityTokens":{"type":"object","description":"Token count for a single modality (text, image, audio, video, document).","properties":{"modality":{"type":"string","description":"Response/input modality.","enum":["text","image","audio","video","document"]},"tokens":{"type":"integer","description":"Number of tokens for this modality."}}},"InteractionsError":{"type":"object","description":"Gemini-shaped error envelope returned by the Interactions surface.","properties":{"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"status":{"type":"string","description":"Google-style status string (e.g. INVALID_ARGUMENT, RESOURCE_EXHAUSTED, PROVIDER_ERROR)."}},"required":["code","message","status"]}}}},"responses":{"UnauthorizedError":{"description":"Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.\n\nNote: the 401 error body uses `code`, `message`, `param`, and `type` (there is no `status` field), and `type` is `invalid_request_error`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"InsufficientCreditsError":{"description":"Insufficient Credits - Your account or API key has run out of credits. Add more credits and retry the request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}},"RateLimitError":{"description":"Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}},"InternalServerError":{"description":"Internal Error - Something went wrong on our side. Retry the request, and contact support if the issue persists.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}}}},"paths":{"/v1/interactions/{id}":{"get":{"operationId":"getInteraction","tags":["Interactions"],"summary":"Get Interaction","description":"Retrieves a previously stored interaction by FastRouter `fr_…` id (or upstream id). Use the returned `id` with `previous_interaction_id` on a later create to continue the conversation (e.g. Omni video edits). Alias: `/api/v1/interactions/{id}`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Interaction id returned by create (`fr_…`) or an upstream id."}],"responses":{"200":{"description":"Stored interaction resource. Same shape as a completed create response (FastRouter `fr_…` id and `usage.cost` / `usage.chat_id` when present).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Interaction"}}}},"400":{"description":"Bad request (missing/invalid model, invalid previous_interaction_id, unsupported provider.only, etc.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionsError"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"402":{"$ref":"#/components/responses/InsufficientCreditsError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"description":"Upstream / routing failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionsError"}}}}}}}}}
```

## Delete Interaction

> Deletes a stored interaction by id. Alias: \`/api/v1/interactions/{id}\`.

```json
{"openapi":"3.1.0","info":{"title":"FastRouter API Reference","version":"1.0.0"},"tags":[{"name":"Interactions","description":"Google Gemini Interactions API (successor to generateContent). FastRouter forwards to Google AI Studio with routing, sticky `previous_interaction_id`, credits billing, and client-facing `fr_…` ids. Supports text, image, audio, and video (including Gemini Omni Flash conversational video). Create requests always run to completion before the HTTP response returns (use `stream: true` for SSE deltas while waiting)."}],"servers":[{"url":"https://api.fastrouter.ai","description":"Production API"}],"security":[{"bearerAuth":[]},{"keyQuery":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"FastRouter API Key. Get yours at https://fastrouter.ai\n\nFormat: `Authorization: Bearer YOUR_API_KEY`"},"keyQuery":{"type":"apiKey","in":"query","name":"key","description":"FastRouter API Key (Gemini style). Get yours at https://fastrouter.ai\n\nFormat: `?key=YOUR_API_KEY`"}},"schemas":{"InteractionsError":{"type":"object","description":"Gemini-shaped error envelope returned by the Interactions surface.","properties":{"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"status":{"type":"string","description":"Google-style status string (e.g. INVALID_ARGUMENT, RESOURCE_EXHAUSTED, PROVIDER_ERROR)."}},"required":["code","message","status"]}}}},"responses":{"UnauthorizedError":{"description":"Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.\n\nNote: the 401 error body uses `code`, `message`, `param`, and `type` (there is no `status` field), and `type` is `invalid_request_error`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string"}}}}}}}},"InsufficientCreditsError":{"description":"Insufficient Credits - Your account or API key has run out of credits. Add more credits and retry the request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}},"RateLimitError":{"description":"Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}},"InternalServerError":{"description":"Internal Error - Something went wrong on our side. Retry the request, and contact support if the issue persists.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer"}}}}}}}}}},"paths":{"/v1/interactions/{id}":{"delete":{"operationId":"deleteInteraction","tags":["Interactions"],"summary":"Delete Interaction","description":"Deletes a stored interaction by id. Alias: `/api/v1/interactions/{id}`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Interaction id (`fr_…` or upstream)."}],"responses":{"200":{"description":"Upstream acknowledged deletion (body may be empty or a small status object).","content":{"application/json":{}}},"204":{"description":"Deleted with no response body."},"400":{"description":"Bad request (missing/invalid model, invalid previous_interaction_id, unsupported provider.only, etc.)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionsError"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"402":{"$ref":"#/components/responses/InsufficientCreditsError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"description":"Upstream / routing failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionsError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fastrouter.ai/api-reference/gemini-interactions-api-format.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
