> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini API Compatibility

In addition to Anthropic compatibility, GeekAI provides a Gemini-compatible endpoint for tools such as Gemini CLI. This endpoint **only supports Gemini models**.

To call these models with the Gemini SDK, set the base URL and API key to GeekAI's values, just as you would for an Anthropic-compatible model. All other parameters and calls follow the official Gemini API:

```bash curl theme={null}
curl https://geekai.co/api/v1beta/models/gemini-3-flash-preview:generateContent \
-H "content-type: application/json" \
-H "x-goog-api-key: $GEEKAI_API_KEY" \
-X POST \
-d '{
    "contents": [
      {
        "parts": [
          {
            "text": "Hello, Gemini"
          }
        ]
      }
    ]
  }'
```

```bash python theme={null}
from google import genai
from google.genai import types

client = genai.Client(
    http_options=types.HttpOptions(base_url='https://geekai.co/api'),
    api_key="$GEEKAI_API_KEY"
)

response = client.models.generate_content(
    model="gemini-3.8-flash",
    contents="Hello, Gemini",
)

print(response.text)
```

```bash javascript theme={null}
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({
  apiKey: "$GEEKAI_API_KEY",
  httpOptions: {
    baseUrl: "https://geekai.co/api",
  },
});

async function main() {
  const response = await ai.models.generateContent({
    model: "gemini-3.8-flash",
    contents: "Hello, Gemini",
  });
  console.log(response.text);
}

await main();
```

```bash go theme={null}
package main

import (
    "context"
    "fmt"
    "log"
    "google.golang.org/genai"
)

func main() {
    ctx := context.Background()
    httpOptions := genai.HTTPOptions{
      BaseURL:    "https://geekai.co/api",
      APIVersion: "v1beta",
    }
    client, err := genai.NewClient(ctx,
      &genai.ClientConfig{
				APIKey:      "$GEEKAI_API_KEY",
				Backend:     genai.BackendGeminiAPI,
				HTTPOptions: httpOptions,
			},
    )
    if err != nil {
        log.Fatal(err)
    }

    result, err := client.Models.GenerateContent(
        ctx,
        "gemini-3.8-flash",
        genai.Text("Hello, Gemini"),
        nil,
    )
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(result.Text())
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.