Skip to main content

Overview

Bifrost supports the Google GenAI Files API and Batch API with cross-provider routing. This means you can use the Google GenAI SDK to manage files and batch jobs across multiple providers including Gemini, OpenAI, Anthropic, and Bedrock. The provider is specified using the x-model-provider header in HttpOptions.
Bedrock Limitation: Bedrock batch operations require file-based input with S3 storage, which is not fully supported via the GenAI SDK’s batch API. For Bedrock batch operations, use the Bedrock SDK directly.

Client Setup

Gemini Provider (Default)

Cross-Provider Client Setup

To route requests to different providers, add the x-model-provider header:

Helper Function for Provider-Specific Clients


Files API

Files are managed through the client.files namespace.

Upload a File

List Files

Retrieve File Metadata

Delete a File


Batch API

Batches are managed through the client.batches namespace. The GenAI SDK supports both file-based and inline batch creation.

Create a Batch with File

Create a Batch with Inline Requests

List Batches

Retrieve Batch Status

Cancel a Batch

Delete a Batch


End-to-End Workflows

Gemini Batch Workflow

OpenAI via GenAI SDK Workflow

Anthropic via GenAI SDK Workflow


Batch Job States


JSON Format Reference

Gemini Batch Format

Inline Request Format


Provider-Specific Notes

  • Gemini and OpenAI support both file-based and inline batch creation
  • Anthropic only supports inline batch requests via this SDK
  • Bedrock requires the Bedrock SDK for full batch support

Next Steps