API Reference

Complete API reference for Gemini CLI with endpoints, parameters, and examples

Authentication

All API requests require authentication using your API key. Include your API key in the Authorization header of every request.

Header Example

Authorization: Bearer YOUR_API_KEY

Important: Keep your API key secure and never expose it in client-side code.

Rate Limits

Free Tier

1,000

requests per day

Per Minute

60

requests per minute

Context Window

1M

token context window

API Endpoints

POST/v1/generate

Generate text using Gemini models

Request

curl -X POST \
https://api.gemini-guide.com/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Your prompt here"}'

Response

{
"status": "success",
"data": {
"response": "Generated content...",
"model": "gemini-pro",
"usage": {
"tokens": 150
}
}
}
POST/v1/chat

Start or continue a chat conversation

Request

curl -X POST \
https://api.gemini-guide.com/v1/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Your prompt here"}'

Response

{
"status": "success",
"data": {
"response": "Generated content...",
"model": "gemini-pro",
"usage": {
"tokens": 150
}
}
}
GET/v1/models

List available models

Request

curl -X GET \
https://api.gemini-guide.com/v1/models \
-H "Authorization: Bearer YOUR_API_KEY" \

Response

{
"status": "success",
"data": {
"response": "Generated content...",
"model": "gemini-pro",
"usage": {
"tokens": 150
}
}
}
GET/v1/usage

Get API usage statistics

Request

curl -X GET \
https://api.gemini-guide.com/v1/usage \
-H "Authorization: Bearer YOUR_API_KEY" \

Response

{
"status": "success",
"data": {
"response": "Generated content...",
"model": "gemini-pro",
"usage": {
"tokens": 150
}
}
}

Error Codes

400Bad Request

Invalid request parameters

401Unauthorized

Invalid or missing API key

429Too Many Requests

Rate limit exceeded

500Internal Server Error

Server error occurred

Ready to Start Building?

Get started with our API and build amazing applications.