canonical: https://jentic.com/apis/codegpt.co/codegpt

# CodeGPT API Beta

Jentic publishes the only available OpenAPI specification for CodeGPT API Beta, keeping it validated and agent-ready. CodeGPT is a developer-focused AI platform for building and running coding-oriented agents, complete with a marketplace of pre-built agents, a chat completions endpoint, and document grounding for retrieval-augmented generation. The v2 beta API exposes 18 endpoints over api.codegpt.co covering user profile management, agent CRUD, agent image and document attachments, OpenAI-compatible chat completions, and document storage with metadata. Authentication is a JWT Bearer token, and the spec is explicitly marked beta and subject to change.

## For AI agents

Create and manage CodeGPT agents, attach documents for RAG, and run chat completions against them using a JWT Bearer token.

## Scope

Does not handle billing, model fine-tuning, or workspace administration - use for agent, document, and chat completion operations on CodeGPT only.

## Capabilities

- Create a CodeGPT agent with a system prompt and model via POST `/api/v1/agent`
- Attach grounding documents to an agent through PATCH `/api/v1/agent/{id}/documents`
- Run an OpenAI-compatible chat completion against a CodeGPT agent via POST `/api/v1/chat/completions`
- Upload, list, retrieve, and delete documents that back agent retrieval through `/api/v1/document` endpoints
- Update agent metadata, avatar, or backing documents without redeploying the agent
- List the agents a user has marked as marketplace favourites for quick reuse
- Update document metadata to drive filtered retrieval at chat time

## Use cases

### Custom Coding Assistant Per Repository

Stand up a dedicated coding assistant for each repository by creating a CodeGPT agent and attaching the repo's docs as grounding documents. The agent is then callable through POST `/api/v1/chat/completions`, giving developers an in-IDE assistant that knows the codebase. Replaces generic chat models that hallucinate when asked about internal APIs.

Example prompt: Call POST `/api/v1/agent` to create an agent named 'payments-helper', then PATCH `/api/v1/agent/{id}/documents` to attach the payments service README and architecture docs

### RAG-Backed Internal Knowledge Bot

Use CodeGPT's document store as the retrieval layer for an internal knowledge bot. Engineers POST documents to `/api/v1/document`, attach them to a single 'knowledge' agent, and call chat completions to answer questions grounded in the latest internal docs. Eliminates a separate vector database for small to mid-sized doc collections.

Example prompt: POST every markdown file in the docs/ directory to `/api/v1/document`, attach the resulting ids to agent 'knowledge-bot' via PATCH `/api/v1/agent/{id}/documents`, then test with a chat completion

### Marketplace Agent Reuse

Discover and reuse pre-built agents from the CodeGPT marketplace by reading the favourites list and triggering chat completions against them. Saves teams from rebuilding common agents (code reviewer, README writer, SQL helper) and lets them iterate on prompts inside CodeGPT's UI while consuming the agent over the API.

Example prompt: Call GET `/api/v1/agent/marketplace-favorites`, pick the 'README Writer' agent, then run POST `/api/v1/chat/completions` with that agent id and a prompt describing the new repo

### Document Metadata Filtering

Tag documents with metadata when uploading so the same agent can answer questions about different products without context bleed. The agent uses POST `/api/v1/document/metadata` at retrieval time to scope the search. Useful when a single CodeGPT workspace serves multiple product lines.

Example prompt: PATCH `/api/v1/document/{id}/metadata` to add product=billing on every billing doc, then POST `/api/v1/document/metadata` with product=billing to confirm only billing docs match

### Agent-Driven CodeGPT Orchestration via Jentic

An AI agent connected to Jentic can provision a fresh CodeGPT agent, upload documents, and run a chat completion in a single workflow. Jentic stores the JWT Bearer token in its vault and exposes the operations through an intent-search interface. The orchestrating agent never holds the raw token.

Example prompt: Search Jentic for 'create CodeGPT agent', execute POST `/api/v1/agent`, then call POST `/api/v1/chat/completions` against the new agent and return the first assistant message

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/v1/agent` | Create a new agent |
| GET | `/api/v1/agent` | List agents |
| PATCH | `/api/v1/agent/{id}` | Update an agent |
| PATCH | `/api/v1/agent/{id}/documents` | Attach documents to an agent |
| POST | `/api/v1/chat/completions` | Run a chat completion against an agent |
| POST | `/api/v1/document` | Upload a document |
| GET | `/api/v1/document` | List documents |
| POST | `/api/v1/document/metadata` | Query documents by metadata |

## Key resources

- **User** — Read and update the authenticated user's profile and avatar
- **Agents** — Create, retrieve, list, update, and delete CodeGPT agents and their images
- **Marketplace Favourites** — List agents the user has marked as favourites in the CodeGPT marketplace
- **Chat Completions** — Run OpenAI-compatible chat completions against any agent
- **Documents** — Upload, retrieve, list, delete documents and manage their metadata for agent grounding

## Why Jentic

- **Setup:** Wiring the CodeGPT API by hand means building its Bearer header from a JWT, targeting api.codegpt.co, and managing token handling across agent, document, and chat-completion calls yourself. Through Jentic you install once, import the CodeGPT API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** CodeGPT puts the agent id in the URL path (`/api/v1/agent/{id}` and `/api/v1/agent/{id}/documents`), so a rule can pin your agent to one CodeGPT agent: it can read and update that agent and its documents and nothing else. You choose the operations it may call, so creating new agents or running chat completions is only in the allowed set if you add it.
- **Credential handling:** Your CodeGPT token is stored once, encrypted, by your own Jentic One instance and injected at execution time as the Bearer token. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a coding agent' or 'attach a document to an agent', and Jentic returns the matching CodeGPT operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenAI API** — OpenAI's chat completions and assistants API offers a comparable agent and RAG surface backed by GPT-4 family models
- **Anthropic API** — Claude messages API provides chat completions for coding tasks with strong reasoning at long context lengths
- **GitHub API** — Pair CodeGPT agents with the GitHub API to read repository contents and post pull request review comments

## FAQ

### Why is there no official OpenAPI spec for CodeGPT API Beta?

CodeGPT does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call CodeGPT API Beta via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the CodeGPT API Beta use?

The CodeGPT API Beta uses HTTP Bearer authentication with a JWT issued by CodeGPT. Send it as Authorization: Bearer {jwt}. Through Jentic the JWT is stored in the vault and refreshed on the agent's behalf, so the raw token never enters agent context.

### Can I attach my own documents to a CodeGPT agent?

Yes. Upload each document with POST `/api/v1/document`, then call PATCH `/api/v1/agent/{id}/documents` with the resulting document ids to bind them to the agent. The agent will use those documents as grounding context during chat completions.

### What are the rate limits for the CodeGPT API?

CodeGPT does not publish a public rate limit in the spec, and limits depend on plan tier. Treat the API as best-effort and back off on HTTP 429 responses. Because the spec is marked beta, also expect schema or limit changes between versions.

### How do I run a chat completion through Jentic?

Search Jentic for 'CodeGPT chat completion', load the POST `/api/v1/chat/completions` schema, and execute it with an agent id and messages array. Jentic injects the Bearer token from the vault and returns the parsed completion.

### Is the CodeGPT API stable?

No. The spec is explicitly labelled beta and the vendor states it is subject to change. Pin agents and tooling to a specific schema version, and expect to revisit integrations when CodeGPT promotes a new release.

### Can I limit what my agent is allowed to do with the CodeGPT API?

Yes. Because you run Jentic One yourself, your own rules decide which CodeGPT operations the agent may call and which credentials it may use. Since CodeGPT puts the agent id in the URL path, such as `/api/v1/agent/{id}` and `/api/v1/agent/{id}/documents`, you can pin the agent to a single CodeGPT agent so it only reads and updates that agent and its documents. Operations like creating new agents with POST `/api/v1/agent` or running POST `/api/v1/chat/completions` are available only if you add them to the allowed set.
