This guide will walk you through connecting your GitHub repository and making your first API request.

Prerequisites

GitHub Repository

A GitHub repository you want to query. We support both public and private repositories

Connecting Your Repository

1

Connect GitHub

  1. Navigate to Github Integrations page

  2. Click on “Connect” to authorize Depth AI to connect to your Github account

  3. Add the repositories that you want to index on the Github authentication redirect. You can also use the “Configure” button to add more permissions later.

2

Select Repository

Enter the Github repository URL for the repo you want to add

3

Configure repository settings and start indexing

Click “Start Indexing” to begin the indexing process. This may take a few hours depending on the repository size.

The indexing process needs to complete before you can start querying your repository through the API.

Authentication

To use the Depth API, you’ll need an API key. Here’s how to get one:

1

Generate API Key

  1. Go to API Keys page in Organisation Settings

  2. Click “Create New API Key”

  3. Give your key a name and click “Create”

  4. Copy and securely store your API key

2

Using the API Key

Include your API key in the requests using Bearer authentication:

Never share your API key or commit it to version control. Use environment variables to store sensitive credentials.

API Parameters

Error Handling

401 Unauthorized

Invalid API key or insufficient repository access

404 Not Found

Requested model not found. We only support gpt-4o in the Free Tier

For detailed error responses, check the error object in the response body:

{
  "error": {
    "message": "Error message",
    "type": "error_type",
    "param": "parameter_name",
    "code": "error_code"
  }
}

Need Help?

If you face any issues or have questions, we’re here to help! Contact us at founders@trydepth.ai - we typically reply within minutes.

Contact Support

Email us at founders@trydepth.ai for quick assistance