Documentation

MCP Tools

3rd Party API Compatible Tools

Comprehensive guide to AI development tools that support 3rd party OpenAI-compatible APIs like A4F, with specific configurations and compatibility notes.

Image Placeholder: Generic MCP Tool Configuration
Location: /public/docs/mcp-tools/generic-mcp-config.png

Introduction

As a 3rd party API provider, A4F works with AI development tools that explicitly support custom OpenAI-compatible endpoints. This guide provides specific configurations for popular tools that support 3rd party APIs, along with important notes about tools that currently don't support external providers.

Tools That Support 3rd Party APIs

Continue VS Code Extension

Continue is one of the most popular open-source AI coding assistants that fully supports custom API providers:

{
"models": [
{
"title": "A4F GPT-4o",
"provider": "openai",
"model": "provider-1/chatgpt-4o-latest",
"apiKey": "YOUR_A4F_API_KEY",
"apiBase": "https://api.a4f.co/v1"
},
{
"title": "A4F Claude 3.5 Sonnet",
"provider": "openai",
"model": "provider-3/claude-3-5-sonnet-20241022",
"apiKey": "YOUR_A4F_API_KEY",
"apiBase": "https://api.a4f.co/v1"
}
],
"tabAutocompleteModel": {
"title": "A4F GPT-4o Mini",
"provider": "openai",
"model": "provider-1/gpt-4o-mini",
"apiKey": "YOUR_A4F_API_KEY",
"apiBase": "https://api.a4f.co/v1"
}
}

Aider Command Line Tool

Aider is a command-line AI coding assistant that works excellently with A4F:

# Set environment variables
export OPENAI_API_KEY="YOUR_A4F_API_KEY"
export OPENAI_API_BASE="https://api.a4f.co/v1"
# Use A4F models with Aider
aider --model openai/provider-1/chatgpt-4o-latest
aider --model openai/provider-3/claude-3-5-sonnet-20241022
# Or create a .aider.conf.yml file:
# openai-api-key: YOUR_A4F_API_KEY
# openai-api-base: https://api.a4f.co/v1
# model: openai/provider-1/chatgpt-4o-latest

Claude Code

Claude Code is an AI development environment that supports custom API endpoints:

{
"apiProvider": "custom",
"customProvider": {
"name": "A4F",
"baseUrl": "https://api.a4f.co/v1",
"apiKey": "${A4F_API_KEY}",
"models": [
{
"id": "provider-3/claude-3-5-sonnet-20241022",
"name": "Claude 3.5 Sonnet (A4F)",
"contextLength": 200000
},
{
"id": "provider-1/chatgpt-4o-latest",
"name": "GPT-4o Latest (A4F)",
"contextLength": 128000
}
]
},
"defaultModel": "provider-3/claude-3-5-sonnet-20241022"
}

Codeium

Codeium supports custom API endpoints for enterprise users and advanced configurations:

{
"api": {
"provider": "openai-compatible",
"baseUrl": "https://api.a4f.co/v1",
"apiKey": "YOUR_A4F_API_KEY",
"model": "provider-1/chatgpt-4o-latest"
},
"features": {
"codeCompletion": true,
"chatAssistant": true,
"codeExplanation": true
}
}

LangChain Framework

LangChain has excellent support for OpenAI-compatible APIs, making it easy to use A4F:

from langchain_openai import ChatOpenAI
# Configure LangChain to use A4F
llm = ChatOpenAI(
model="provider-1/chatgpt-4o-latest",
openai_api_key="YOUR_A4F_API_KEY",
openai_api_base="https://api.a4f.co/v1",
temperature=0.7
)
# Use with LangChain chains
from langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
prompt = PromptTemplate(
input_variables=["question"],
template="Answer the following question: {question}"
)
chain = LLMChain(llm=llm, prompt=prompt)
response = chain.run("What is machine learning?")

Other Supported Tools

  • KILO Code: Development environment with 3rd party API integration support
  • Tabnine: AI code completion with enterprise API support for custom providers
  • LlamaIndex: Data framework supporting custom LLM endpoints
  • OpenAI Python/JS SDKs: Can be configured to use A4F endpoints directly
  • Make.com & Zapier: Workflow automation platforms with HTTP request nodes
  • Flowise: Low-code LLM orchestration tool with custom provider support
  • LangFlow: Visual framework for building LangChain flows with custom APIs

Tools With Limited/No 3rd Party Support

The following popular tools currently do not support 3rd party OpenAI-compatible APIs:

  • Cursor: AI-first code editor that currently only supports its built-in AI providers
  • GitHub Copilot: Restricted to GitHub's infrastructure, no external API support
  • GitHub Copilot Chat: Does not support external OpenAI-compatible endpoints
  • JetBrains AI Assistant: Limited to JetBrains' approved AI providers
  • Replit AI: Uses internal AI infrastructure only
  • CodeWhisperer (Amazon): AWS-only service, no 3rd party API support

How to Identify 3rd Party API Support

When evaluating whether an AI tool supports 3rd party APIs like A4F, look for these indicators:

  • Custom API Endpoint Settings: Look for options to set a custom base URL or API endpoint
  • OpenAI-Compatible Provider: Tools that mention "OpenAI-compatible" or "OpenAI API" support
  • API Key Configuration: Ability to use your own API key instead of built-in credits
  • Model Selection: Options to specify custom model names or identifiers
  • Enterprise/Self-Hosted Options: Tools offering enterprise deployments often support custom APIs
  • Open Source: Open-source tools typically allow more flexibility in API configuration

Generic Configuration Template

For tools not specifically covered above, most that support OpenAI-compatible APIs will accept a configuration similar to this template:

{
"llm": {
"provider": "openai-compatible",
"baseUrl": "https://api.a4f.co/v1",
"apiKey": "YOUR_A4F_API_KEY",
"model": "provider-1/chatgpt-4o-latest",
"temperature": 0.7,
"maxTokens": 2000
},
"features": {
"streaming": true,
"functionCalling": true,
"vision": true
},
"headers": {
"x-a4f-cache": "read",
"x-a4f-metadata-user-id": "your-user-id"
}
}

Best Practices

  • Model Selection: Choose models based on your task—use powerful models like Claude or GPT-4 for complex reasoning and lighter models for simple, fast operations.
  • Rate Limiting: Be mindful of your A4F plan's rate limits. Configure your tools to avoid sending too many requests in a short period.
  • Error Handling: If your tool supports it, implement retry logic with exponential backoff for robustness.
  • Security: Always use environment variables or your tool's built-in credential manager for your A4F API key.
  • Monitoring: Keep an eye on your usage and costs through your A4F dashboard.

Troubleshooting

If you encounter issues, the first step is to verify that your A4F API key and the endpoint are working correctly. You can do this with a simple cURL command:

# Test your A4F API key and connection
curl -X POST "https://api.a4f.co/v1/chat/completions" \
-H "Authorization: Bearer YOUR_A4F_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "provider-1/chatgpt-4o-latest",
"messages": [{"role": "user", "content": "Connection test"}],
"max_tokens": 10
}'

Common Issues

For additional support, check our Error Documentation or contact support.

Was this page helpful?