GitHub Models
GitHub Models — developer-friendly, OpenAI-compatible chat, vision, function calling, and embeddings.
Overview
GitHub Models gives developers access to a curated catalog of popular AI models through a familiar, OpenAI-compatible interface.
Official Website: https://github.com/marketplace/models API Documentation: https://docs.github.com/en/github-models
Key features
- Developer-friendly — easy setup with a familiar OpenAI-compatible API
- Chat — text generation across a range of popular models
- Vision — image understanding
- Function calling — tool use for agentic workflows
- Embeddings — text embeddings for semantic search
Using GitHub Models with Yunxin
Address GitHub Models by prefixing the model id with the github slug — github/<model>. You always call the same Yunxin base URL, https://api.yuhuanstudio.com/v1, with your sk- API key; Yunxin routes the request to GitHub Models.
Usage example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["YUNXIN_API_KEY"],
base_url="https://api.yuhuanstudio.com/v1",
)
response = client.chat.completions.create(
model="github/model-id",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"},
],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.YUNXIN_API_KEY,
baseURL: "https://api.yuhuanstudio.com/v1",
});
const response = await client.chat.completions.create({
model: "github/model-id",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Hello!" },
],
});
console.log(response.choices[0].message.content);curl https://api.yuhuanstudio.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YUNXIN_API_KEY" \
-d '{
"model": "github/model-id",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'Available models
List the models currently available for this provider:
curl "https://api.yuhuanstudio.com/v1/models?provider=github" \
-H "Authorization: Bearer $YUNXIN_API_KEY"Capabilities and pricing are per-model. Use the Models API to discover which GitHub Models are available and what each one supports.
Official resources
How is this guide?