Gemini Style Interface
Some applications or SDKs use Gemini API paths. CoreRouter provides Gemini-compatible routing for easy direct integration with these clients.
Interface Information
| Configuration | Value |
|---|---|
| Base URL | https://api.corerouter.cloud |
| Generation Interface | /v1beta/models/{model}:generateContent |
| Streaming Interface | /v1beta/models/{model}:streamGenerateContent |
| Model List | /v1beta/models |
| OpenAI Style Model List | /v1beta/openai/models |
| Authentication | x-goog-api-key, ?key= or Authorization: Bearer ... |
Model names still use Model IDs from CoreRouter console. Different Gemini clients may auto-append models/ or API paths; fill according to client requirements.
Query Gemini Model List
Native Gemini-style clients can call:
bash
curl https://api.corerouter.cloud/v1beta/models \
-H "x-goog-api-key: $COREROUTER_API_KEY"If the client uses Gemini-compatible connection but only requests OpenAI-style model list, use:
bash
curl https://api.corerouter.cloud/v1beta/openai/models \
-H "Authorization: Bearer $COREROUTER_API_KEY"Both list interfaces only return models visible to the current API Key, not all server models.
Using x-goog-api-key
bash
export COREROUTER_API_KEY="sk-xxxxxxxxxxxxxxxx"
curl "https://api.corerouter.cloud/v1beta/models/gemini-model-id:generateContent" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $COREROUTER_API_KEY" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{"text": "Hello, please introduce yourself."}
]
}
]
}'Using Query Parameter key
bash
curl "https://api.corerouter.cloud/v1beta/models/gemini-model-id:generateContent?key=$COREROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{"text": "Introduce CoreRouter in three sentences."}
]
}
]
}'Streaming Output
bash
curl "https://api.corerouter.cloud/v1beta/models/gemini-model-id:streamGenerateContent" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $COREROUTER_API_KEY" \
-d '{
"contents": [
{
"parts": [
{"text": "List three API integration considerations one by one."}
]
}
]
}'Common Issues
- Client requires Google API Key: Fill CoreRouter API Key.
- Model not found: Confirm model name in path comes from CoreRouter console.
- Duplicate paths: If client already appends
/v1beta/models/..., Base URL only fillshttps://api.corerouter.cloud. - Parameters not working: Gemini-style parameters differ from OpenAI-style parameters; use field names corresponding to the client.
