> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codealive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ChatGPT

> Connect CodeAlive with ChatGPT using a custom MCP app

## Overview

Connect ChatGPT to CodeAlive's remote MCP server with browser OAuth. The older Custom GPT Actions integration remains available as an API-key fallback.

## Prerequisites

* ChatGPT Business, Enterprise, or Edu workspace with custom MCP apps enabled
* CodeAlive account ([Sign up here](https://app.codealive.ai))
* Indexed repositories in your CodeAlive dashboard

## Integration Methods

> [tab] Custom MCP app (Recommended)
>
> ## Create a CodeAlive app in ChatGPT
>
> **1. Enable developer mode**
>
> A workspace admin enables **Developer mode / Create custom MCP connectors** under **Workspace Settings → Permissions & Roles → Connected Data**. Enterprise and Edu workspaces can grant this through RBAC.
>
> **2. Create the app**
>
> In **Settings → Apps → Create**, enter the CodeAlive MCP endpoint:
>
> ```text theme={null}
> https://mcp.codealive.ai/api
> ```
>
> Choose OAuth when ChatGPT asks for the authentication mechanism.
>
> **3. Authenticate and scan tools**
>
> Click **Scan Tools**, complete the CodeAlive browser sign-in and consent screen, then wait for ChatGPT to finish scanning. The app exposes read-only CodeAlive tools such as `get_data_sources`, `semantic_search`, `grep_search`, and `read_file`.
>
> **4. Test and publish**
>
> Select the draft app in a new chat and ask, “What CodeAlive repositories are available?” Workspace admins can publish the tested app and control access through ChatGPT's app settings.
>
> > [!NOTE]
> >
> > Each user authorizes their own CodeAlive access. Do not configure a shared API key for the MCP app.

> [tab] Custom GPT Action (API key)
>
> ## Create a Custom GPT with CodeAlive
>
> Custom GPTs allow you to create a specialized version of ChatGPT that connects to CodeAlive.
>
> **1. Create a New GPT**
>
> 1. Go to [chat.openai.com](https://chat.openai.com)
> 2. Click on "Explore GPTs" in the sidebar
> 3. Click "Create" to build a new GPT
>
> **2. Configure GPT Instructions**
>
> Set up your GPT with these instructions:
>
> ```
> You are a code assistant with access to CodeAlive, which provides
> semantic search and analysis of entire codebases. You can:
>
> 1. Search for code implementations across repositories
> 2. Understand project architecture and patterns
> 3. Find related code and dependencies
> 4. Generate code following existing patterns
>
> Always use CodeAlive to:
> - Search for existing implementations before writing new code
> - Understand the codebase context
> - Follow established patterns and conventions
> ```
>
> **3. Add CodeAlive Action**
>
> 1. Click on "Configure" → "Add Actions"
> 2. Import the CodeAlive OpenAPI schema:
>
> ```json theme={null}
> {
>   "openapi": "3.1.1",
>   "info": {
>     "title": "CodeAlive Tool API",
>     "version": "3.0.0"
>   },
>   "servers": [
>     {
>       "url": "https://app.codealive.ai"
>     }
>   ],
>   "paths": {
>     "/api/tools/get_data_sources": {
>       "post": {
>         "operationId": "ToolApiGetDataSources",
>         "summary": "List available repositories",
>         "requestBody": {
>           "required": true,
>           "content": {
>             "application/json": {
>               "schema": {
>                 "type": "object",
>                 "additionalProperties": false,
>                 "properties": {
>                   "query": {"type": "string"},
>                   "ready_only": {"type": "boolean"},
>                   "output_format": {"type": "string", "enum": ["json", "agentic"]}
>                 }
>               }
>             }
>           }
>         },
>         "security": [{"bearerAuth": []}]
>       }
>     },
>     "/api/tools/semantic_search": {
>       "post": {
>         "operationId": "ToolApiSemanticSearch",
>         "summary": "Search code semantically",
>         "requestBody": {
>           "required": true,
>           "content": {
>             "application/json": {
>               "schema": {
>                 "type": "object",
>                 "additionalProperties": false,
>                 "required": ["question"],
>                 "properties": {
>                   "question": {"type": "string"},
>                   "data_sources": {
>                     "type": "array",
>                     "items": {"type": "string"}
>                   },
>                   "paths": {"type": "array", "items": {"type": "string"}},
>                   "extensions": {"type": "array", "items": {"type": "string"}},
>                   "max_results": {"type": "integer"},
>                   "output_format": {"type": "string", "enum": ["json", "agentic"]}
>                 }
>               }
>             }
>           }
>         },
>         "security": [{"bearerAuth": []}]
>       }
>     },
>     "/api/tools/chat": {
>       "post": {
>         "operationId": "ToolApiChat",
>         "summary": "Ask a stateless question about code",
>         "requestBody": {
>           "required": true,
>           "content": {
>             "application/json": {
>               "schema": {
>                 "type": "object",
>                 "additionalProperties": false,
>                 "required": ["question"],
>                 "properties": {
>                   "question": {"type": "string"},
>                   "data_sources": {
>                     "type": "array",
>                     "items": {"type": "string"}
>                   },
>                   "output_format": {"type": "string", "enum": ["json", "agentic"]}
>                 }
>               }
>             }
>           }
>         },
>         "security": [{"bearerAuth": []}]
>       }
>     }
>   },
>   "components": {
>     "securitySchemes": {
>       "bearerAuth": {
>         "type": "http",
>         "scheme": "bearer"
>       }
>     }
>   }
> }
> ```
>
> **4. Add Authentication**
>
> 1. In the Actions configuration, click "Authentication"
> 2. Select "API Key"
> 3. Auth Type: "Bearer"
> 4. Add your CodeAlive API key
>
> **5. Test Your GPT**
>
> Test with queries like:
>
> * "What repositories are available in CodeAlive?"
> * "Search for authentication implementations"
> * "Explain the user service architecture"

> [tab] Direct API Calls
>
> ## Use CodeAlive API Directly in ChatGPT
>
> You can also manually provide API responses to ChatGPT for analysis.
>
> **1. Make API Request**
>
> Use curl or any HTTP client to query CodeAlive:
>
> ```bash theme={null}
> curl -X POST https://app.codealive.ai/api/tools/semantic_search \
>   -H "Authorization: Bearer YOUR_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{"question": "Where is authentication implemented?", "data_sources": ["your-repo-name"], "output_format": "agentic"}'
> ```
>
> **2. Share with ChatGPT**
>
> Copy the API response and paste it into ChatGPT with context:
>
> ```
> Here's the code search result from my codebase.
> Please analyze this authentication implementation:
>
> [Paste API response]
> ```

## Usage Examples

### Code Search

```
User: "Search my codebase for payment processing logic"

ChatGPT: [Uses CodeAlive action to search]
        Found payment processing in:
        - /services/payment/processor.js
        - /api/routes/checkout.js
        - /lib/payment-gateway.js
```

### Architecture Analysis

```
User: "Explain how the authentication flow works"

ChatGPT: [Searches for auth code via CodeAlive]
        [Analyzes the flow across multiple files]
        [Provides detailed explanation with code references]
```

### Code Generation

```
User: "Create a new API endpoint following our patterns"

ChatGPT: [Searches for existing endpoints]
        [Identifies patterns and conventions]
        [Generates code matching your style]
```

## Advanced Configuration

### Custom GPT Capabilities

Configure your GPT with specific capabilities:

```json theme={null}
{
  "capabilities": {
    "web_browsing": false,
    "dall_e_image_generation": false,
    "code_interpreter": true
  },
  "actions": ["codealive"],
  "conversation_starters": [
    "Search for implementations of...",
    "Explain the architecture of...",
    "Find all references to...",
    "Generate code similar to..."
  ]
}
```

### Rate Limiting

Be aware of rate limits:

* ChatGPT has limits on Actions calls per conversation
* CodeAlive API has rate limits based on your plan
* Use specific queries to minimize API calls

### Privacy Settings

For team/enterprise accounts:

1. Control data sharing in GPT settings
2. Set action permissions (private, team, public)
3. Configure audit logging if required

## Sharing Your GPT

### Make it Public

1. Go to GPT settings
2. Click "Publish" → "Public"
3. Share the GPT link with others
4. Users will need their own CodeAlive API key

### Team Sharing

For ChatGPT Team/Enterprise:

1. Set visibility to "Anyone at \[Your Organization]"
2. Team members can use shared authentication
3. Centrally manage API keys

## Best Practices

> [card] Specific Queries
>
> Use precise search terms to get relevant results

> [card] Context Windows
>
> Be mindful of token limits when searching large codebases

> [card] Caching
>
> Reuse search results within the same conversation

> [card] Security
>
> Never share API keys in conversation

## Troubleshooting

> [accordion] Action fails with authentication error
>
> **Solutions:**
>
> 1. Verify API key is correct
> 2. Check key hasn't expired
> 3. Ensure Bearer prefix is included
> 4. Regenerate key if needed

> [accordion] No results from searches
>
> **Solutions:**
>
> 1. Verify repositories are indexed
> 2. Check search query syntax
> 3. Test API directly with curl
> 4. Check rate limits

> [accordion] GPT not using CodeAlive action
>
> **Solutions:**
>
> 1. Explicitly ask to "use CodeAlive"
> 2. Check action is enabled
> 3. Verify OpenAPI schema is valid
> 4. Review GPT instructions

> [accordion] Rate limit exceeded
>
> **Solutions:**
>
> 1. Reduce frequency of searches
> 2. Use more specific queries
> 3. Upgrade CodeAlive plan
> 4. Cache results when possible

> [!TIP]
>
> For more solutions, see the [Troubleshooting Guide](https://docs.codealive.ai/troubleshooting.md).

## Limitations

> [!WARNING]
>
> **Current Limitations:**
>
> * ChatGPT can't maintain persistent connections
> * Actions have timeout limits (30 seconds)
> * Token limits may truncate large responses
> * No real-time code updates

## Alternatives

If ChatGPT doesn't meet your needs, consider:

> [card] [Claude Code](https://docs.codealive.ai/integrations/mcp/claude-code.md)
>
> Native MCP support with real-time updates

> [card] [Cursor](https://docs.codealive.ai/integrations/mcp/cursor.md)
>
> IDE-integrated AI with MCP

> [card] [Continue](https://docs.codealive.ai/integrations/mcp/continue.md)
>
> Open-source alternative with MCP

> [card] [API Direct](https://docs.codealive.ai/api-reference/toolapi/list-visible-data-sources.md)
>
> Build custom integration

## Related Resources

* [OpenAI GPTs Documentation](https://help.openai.com/en/articles/8554397-gpts)
* [ChatGPT Actions Guide](https://platform.openai.com/docs/actions)
* [CodeAlive API Reference](https://docs.codealive.ai/api-reference/toolapi/list-visible-data-sources.md)
* [MCP Overview](https://docs.codealive.ai/integrations/mcp.md)

## Instruct Your Agent

Connecting CodeAlive makes its tools available, but the agent may still default to its built-in search. For reliable results, add a short instruction in the agent's native format telling it to prefer `semantic_search` and `grep_search` when exploring indexed code. See [Instructing Coding Agents](https://docs.codealive.ai/guides/instructing-agents.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.