gpt-4o — Free API

Created by OpenAI ⭐ Score: 51
github-models/gpt-4o
🛠️ Function Calling JSON Mode chat

What is gpt-4o?

GPT-4o is OpenAI's flagship multimodal model, available for free via GitHub Models with no credit card — just a GitHub account. While it supports image inputs natively on OpenAI's own API, the GitHub Models free tier currently serves the text-only path with 128K context and 16K max output. Rate limits are 10 RPM and 50 requests per day, and per-request caps of 8K input / 4K output tokens apply, so it is best for prompt engineering, model evaluation, and personal projects. Fully OpenAI SDK-compatible — drop in the GitHub Models base URL and your GitHub token, and existing OpenAI SDK code works unchanged.

Model ID
gpt-4o
Base URL
https://models.github.ai/inference

gpt-4o API Code Example

Paste your API key and run. See the config generator for Claude Code, Cursor, and more tools.

from openai import OpenAI

client = OpenAI(
    base_url="https://models.github.ai/inference",
    api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://models.github.ai/inference",
  apiKey: "YOUR_API_KEY",
});

const completion = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(completion.choices[0].message.content);
curl https://models.github.ai/inference/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Other Free Models from GitHub Models

More About GitHub Models

How to get an API key, rate limits, platform limitations, and tool configuration — everything you need to set up GitHub Models as a free LLM API backend.

View GitHub Models full guide →