Migrating an existing agent with WorkflowAI
Overview
WorkflowAI exposes a compatible OpenAI API endpoint. The only changes you need to make are updating the base_url and api_key.
from openai import OpenAI
# setup WorkflowAI client
client = OpenAI(
base_url="https://run.workflowai.com/v1",
api_key="wai-***", # use create_api_key MCP tool
)
response = client.chat.completions.create(
# your existing code
)import OpenAI from 'openai';
// setup WorkflowAI client
const client = new OpenAI({
baseURL: 'https://run.workflowai.com/v1',
apiKey: 'wai-***', // use create_api_key MCP tool
});
client.chat.completions.create({
// your existing code
})WorkflowAI only supports the OpenAI /v1/chat/completions endpoint. If your existing agent uses other OpenAI endpoints, you'll need to maintain separate clients:
- Supported:
/v1/chat/completions- Migrate this to WorkflowAI - Not Supported:
/v1/embeddings,/v1/responses,/v1/audio/*,/v1/images/*, and other OpenAI endpoints
Migration Strategy: Only change the client configuration for your chat/completions requests. Keep using the standard OpenAI client for all other endpoints (embeddings, responses API, audio transcriptions, image generation, etc.).
When migrating an existing agent to WorkflowAI, you'll get immediate access to 100+ models, observability features, and improved reliability while maintaining full compatibility with your existing chat completion code.
How is this guide?