Call the Gemini API with cURL
These examples show you how to call the Gemini API using curl. You can run them in Colab, or copy/paste the commands into your terminal.
| Quickstart | Description | Open |
|---|---|---|
| Audio | Process audio files with the REST API. | |
| Caching | Cache context to reduce cost and latency using REST. | |
| Embeddings | Generate text embeddings using REST. | |
| Function calling | Perform function calling with cURL and REST. | |
| Function calling config | Configure function calling modes with REST. | |
| Image generation | Generate images with Imagen using the REST API. | |
| JSON mode | Enforce JSON output format with REST. | |
| Models | List and retrieve model metadata with REST. | |
| Prompting | Send text and multimodal prompts with REST. | |
| Safety | Configure safety settings with REST. | |
| Search Grounding | Ground responses with Google Search via REST. | |
| Streaming | Stream responses in real-time with REST. | |
| System instructions | Set system instructions using REST. | |
| Video | Process video files with REST. |