Introduction

The CodeGPT V2 API integrate the Agents and chat functions with CodeGPT

Usage

To use the API effectively, you need to make API calls to the CodeGPT Beta server, providing the necessary parameters.

This essential parameters include:

API Keys

The API Key is a unique identifier used to authenticate your requests to the CodeGPT API. It's like a password that lets the API know it's really you making the request.

You can obtain your API Key from the CodeGPT> API Keys. With this version, you can create a Secret API Key, be sure to saved it properly.

Organization ID

Going forward, it's essential to consider the Organization ID; without it, creating and managing your agents won't be possible. An Organization ID will oversee a group of agents, and additional organizations can be added to generate a new Organization ID. To make changes on Organizations ID, check Settings>Organization.

APIKEYS

You can generate different API keys; this will allow you to manage the privacy of your agents. Remember to save it in a secure place once generated, as it won't be possible to view it in its entirety after creation.

Agent ID

The Agent ID is a unique identifier for the AI Agent you've created in the CodeGPT. It's used to specify which AI Agent should process your requests when you interact with the CodeGPT API.

You can find your Agent ID in the Agents tab within the CodeGPT Playground.

For security reasons, the ID is not displayed in the playground, but when you click 'copy,' the ID is automatically saved to the clipboard.

Messages

The message you send to the API is an object that contains two properties: role and content.

  • role can be 'user' or 'assistant'. It indicates who is sending the message.
  • content is the actual text of the message.

{ "role": "user", "content": "Hello, assistant!" }

This structure helps the API understand the context of the conversation and generate appropriate responses.

Core Functions

This function allows you to retrieve information about a specific agent, including its details and capabilities.

List all available agents, making it easy to browse the models at your disposal.

This function enables you to modify and fine-tune the settings of a specific agent.