This integration method is maintained but no longer actively developed. For the best experience and latest features, use our new AI Gateway with unified API access to 100+ models.
Proxy Integration#
Fetch#
Create an account + Generate an API Key
Create Google Generative AI API Key
Visit the Google Generative AI API Key page. Follow the instructions to create a new API key. Make sure to save the key as you will need it for the next steps.
Set API keys as environment variables
Install necessary packages
Ensure you have the necessary packages installed in your Javascript project:
Send a request using fetch
Google Generative AI SDK#
Create an account + Generate an API Key
Create Google Generative AI API Key
Visit the Google Generative AI API Key page. Follow the instructions to create a new API key. Make sure to save the key as you will need it for the next steps.
Set API keys as environment variables
Install necessary packages
Ensure you have the necessary packages installed in your Javascript project:
Import and configure the client
Generate content using the model
