[!NOTE] This page is for internal Sourcegraph reference - for customer-facing documentation, please refer to Sourcegraph Cody Gateway docs instead.

Cody Gateway can be configured as a provider for Cody completions and Cody embeddings. This page provides enablement to help Sourcegraph teammates grant customers access to Cody Gateway and analyze usage. If you prefer a video format, you can also check out the Intro to Sourcegraph Cody Gateway (5.1) video, which includes some background context as well.

For customers who adopted Cody completions prior to Sourcegraph 5.1.0, see Migrating from Anthropic/OpenAI completions.

To learn more about Cody Gateway, refer to the main Cody Gateway page and the customer-facing documentation.

[!NOTE] Cody Gateway is only available to instances on Sourcegraph 5.1.0 and above. This guidance is not relevant to customers on any previous Sourcegraph release.

Provisioning access

Access to the production Cody Gateway instance can be provisioned with the following steps:

  1. On sourcegraph.com, go to Site admin > Enterprise subscriptions
  2. Find and open a subscription of interest
    1. If you have the license key on hand, you can also use the license key lookup tool.
  3. Under "Cody services":
    1. Enable access to Cody Gateway
    2. If desired, configure custom rate limits to allow more/less usage

Once access is provisioned (i.e. enabled via Cody Gateway), the Sourcegraph instance must be configured as well.

[!WARNING] Changes in Enterprise subscriptions, such as enabling access and configuring custom rate limits, may take around 2 minutes to propagate.

<br />

[!NOTE] Access to cody-gateway.sgdev.org is the same as the above, but requires that the Enterprise subscription's associated license have the dev or internal tag.

<aside> 💡 Per-Enterprise-subscription model allowlists no longer need to be assigned or updated to roll out a new model, or grant access to a new model, for Enterprise customers: Enterprise customers can use any model that Cody Gateway allows.

</aside>

Configuration

[!WARNING] For Sourcegraph Cloud customers, please use the Cody enablement issue to request configuration instead of applying configuration changes yourself or asking the customer to do so.

First, provision access for the customer. Once access has been provisioned, for self-hosted customers please point them to the customer-facing Sourcegraph Cody Gateway docs to enable Cody and self-serve configuration for completions and embeddings.

[!NOTE] The generated access token from provisioning access is generally not required - tokens are automatically generated based on the Sourcegraph instance's license token. In site configuration, we recommend not setting an access token explicitly when using Cody Gateway to take advantage of automatic defaults.

Analyzing usage