Complete documentation for integrating with Gemini's multimodal API endpoints, authentication, and usage examples.
Endpoint | Method | Description |
---|---|---|
/v1/completion | POST | Generate text completions based on prompts |
/v1/codegen | POST | Create production-ready code from natural language |
/v1/image | POST | Generate images and edit existing media |
/v1/summarize | POST | Extract key points from text content |
/v1/search | GET | Query structured information from any input |
{`curl -X POST https://api.gemini.com/v1/completion \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":"Write an article about AI in manufacturing"}'`}
All endpoints require a valid Bearer token in the Authorization header. Get your key from the Developer Console
{`curl -X POST https://api.gemini.com/v1/completion \\ -H "Authorization: Bearer your_api_key" \\ -H "Content-Type: application/json" \\ -d '{ \\ "prompt": "Explain quantum computing in simple terms", \\ "temperature": 0.7 \\ }'`}Copy & Run
{`curl -X POST https://api.gemini.com/v1/codegen \\ -H "Authorization: Bearer your_api_key" \\ -H "Content-Type: application/json" \\ -d '{ \\ "prompt": "Create a React component for a contact form", \\ "language": "tsx" \\ }'`}Try Example
{`curl -X POST https://api.gemini.com/v1/image \\ -H "Authorization: Bearer your_api_key" \\ -H "Content-Type: application/json" \\ -d '{ \\ "prompt": "Cyberpunk city at night with floating cars", \\ "resolution": "2048x2048" \\ }'`}View Results
{`curl -X POST https://api.gemini.com/v1/summarize \\ -H "Authorization: Bearer your_api_key" \\ -H "Content-Type: application/json" \\ -d '{ \\ "content": "Paste your long article here...", \\ "max_length": 200 \\ }'`}Try Summarizer
Tier | Requests/Minute | Cost |
---|---|---|
Free | 50/minute | Free |
Developer | 1000/minute | $0.01 per 1000 requests |
Enterprise | 5000/minute+ | Contact sales |
When rate limits are exceeded, the API returns a 429 Too Many Requests response with retry-after header
Code | Description | Solution |
---|---|---|
400 | Bad Request | Valid JSON formatting issues |
401 | Unauthorized | Invalid or missing API key |
404 | Not Found | Invalid endpoint path |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Error | General server failure |
With secure authentication, low-latency responses, and modern API design - get started for free today.
Get API Key