How to create a Github Models API key to use in Ozeki AI Gateway

This guide demonstrates how to create a Github Models API key and configure it in Ozeki AI Gateway. You'll learn how to access Github's developer settings, generate a personal access token, and set up Github Models as a provider in your gateway. By following these steps, you can connect your Ozeki AI Gateway to Github's AI model inference platform.

API URL: https://models.github.ai/v1
Example API Key: ghp_abc123...
Default model: openai/gpt-5

What is a Github Models API key?

A Github Models API key is a personal access token that allows applications to access AI models through the Github Models platform. Github Models provides access to various AI models with Github's infrastructure and authentication. When configuring Github Models as a provider in Ozeki AI Gateway, you need this personal access token to establish the connection between your gateway and Github's AI services.

Overview
Overview

Steps to follow

  1. Access Github settings
  2. Navigate to developer settings
  3. Create fine-grained token
  4. Configure and generate token
  5. Copy token
  6. Open Providers page in Ozeki AI Gateway
  7. Create provider

How to create a Github Models API key video

The following video shows how to create a Github Models API key and configure it in Ozeki AI Gateway step-by-step. The video covers accessing Github's developer settings, generating a personal access token, and setting up the provider in your gateway.

Step 0 - Install Ozeki AI Gateway

Before configuring Github Models as a provider, ensure Ozeki AI Gateway is installed and running on your system. If you haven't installed Ozeki AI Gateway yet, follow our Installation on Linux guide or Installation on Windows guide to complete the initial setup.

Step 1 - Access Github settings

Open your web browser and navigate to Github. Sign in with your Github account credentials or create an account (Figure 1).

Navigate to Github website
Figure 1 - Navigate to Github website

Click on your profile picture in the top-right corner and select "Settings" to access your account configuration options (Figure 2).

Open profile settings
Figure 2 - Open profile settings

Step 2 - Navigate to developer settings

In the left sidebar of the Settings page, scroll down to the bottom and click on "Developer settings". This section provides access to OAuth apps, Github Apps, and personal access tokens for API authentication (Figure 3).

Enter developer settings
Figure 3 - Enter developer settings

Step 3 - Create fine-grained token

Locate Personal access tokens in the left sidebar and expand it. Click on Fine-grained tokens to access the token management page. Then click the "Generate new token" button to begin creating a new personal access token for Github Models API access (Figure 4).

Begin fine-grained token creation
Figure 4 - Begin fine-grained token creation

Step 4 - Configure and generate token

Enter a descriptive name for your token, such as "Ozeki AI Gateway". Configure the token settings including the expiration date as needed. A clear naming convention helps identify which tokens are used by which applications or services (Figure 5).

Enter token name
Figure 5 - Enter token name and configure settings

After configuring all token settings, scroll to the bottom of the page and click the "Generate token" button. Github will create your personal access token and display it on the next page (Figure 6).

Generate token
Figure 6 - Generate token

Step 5 - Copy token

After generation, Github displays the complete token value. Click the copy button to transfer it to your clipboard. Store this token securely as it provides access to your Github account and Github Models API. The token will not be shown again after you leave this page (Figure 7).

The personal access token is only shown once during creation. Make sure to copy and securely store the token before leaving this page.

Copy token
Figure 7 - Copy token

Step 6 - Open Providers page in Ozeki AI Gateway

Open the Ozeki AI Gateway web interface and navigate to the Providers page. The Providers page displays all configured AI model connections and allows you to add new providers (Figure 6).

Open Providers page
Figure 8 - Open Providers page in Ozeki AI Gateway

Step 7 - Create provider

Click the "New" button on the Providers page to begin creating a provider configuration. This opens a form where you'll specify the connection details for Github AI Models (Figure 9).

Add new provider
Figure 9 - Click add new provider button

Fill in the configuration form. Enter the provider name, select "OpenAI compatible" as the type, paste the endpoint URL (https://models.github.ai/v1), and add your personal access token. Select your preferred model from the dropdown list, then click "Create" to save the configuration (Figure 10).

https://models.github.ai/v1

Enter provider details
Figure 10 - Enter Github Models provider details and create

After clicking "Create", the provider is added to Ozeki AI Gateway. The provider now appears in the list, confirming that your gateway can route requests to Github AI Models services. You can now create routes that allow users to access Github Models through your gateway (Figure 11).

Provider created
Figure 11 - Github Models provider created successfully

To sum it up

You have successfully created a Github Models API key and configured it as a provider in Ozeki AI Gateway. Your gateway can now communicate with Github's AI model platform and access various AI models through Github's infrastructure. This setup allows you to manage Github Models access for multiple users and applications from a centralized point while leveraging Github's authentication and security features.

More information