How to use OpenAI Models for Free with GitHub Models
GitHub provides free access to OpenAI and other AI models for you to play around with them.
Although it is heavily rate limited it’s a good start if you want to play around in LLM models without having to spend some money.
How to get started?
Head over to GitHub Models and select the model that you want to use.
You can use their playground feature to test the models before even we start using this from API.
In order to access the model you need to create a PAT token.
And then you can make API calls like this.
curl -X POST "https://models.github.ai/inference/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-d '{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the capital of France?"
}
],
"temperature": 1.0,
"top_p": 1.0,
"model": "openai/gpt-4.1"
}'
Just replace $GITHUB_TOKEN
with your PAT.
References
Happy inferencing AI!
Was this content helpful?
Help us improve by giving us your feedback.