WorkflowAI
AnotherAI
Agents

Migrating an Existing Agent

Learn how to migrate agents from other platforms or upgrade existing agents with new features and configurations

Migrating From OpenAI to AnotherAI

The easiest way to migrate your agent is to ask Claude Code (or your preferred AI coding agent) to handle it for you:

Can you migrate my agent at @[your-agent-file-path] to use AnotherAI? 
I want to keep all the existing functionality while gaining access to 
AnotherAI's features

Manual Migration Steps

If you prefer to migrate manually or want to understand what changes are needed, follow the steps below.

Update your configuration

There are three main steps to migrating your agent to AnotherAI:

  1. Update your OpenAI client configuration to point to AnotherAI's base URL. (Required)
  2. Add an agent_id in the agent's metadata. This ensures that each agent can be distinguished in AnotherAI's webview. (Recommended)
  3. (For cloud-hosted AnotherAI only) Replace your provider API keys with an AnotherAI API key to allow easy access to 100+ different models. (Recommended)
from openai import OpenAI

client = OpenAI(
    base_url="https://api.anotherai.dev/v1",  # Or http://localhost:8000/v1 for self-hosted
    api_key="aai-***", 
)

# Your existing code works as-is
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "user", "content": "Hello, world!"}
    ],
    metadata={
        "agent_id": "your-agent-name",  # Recommended for observability
    }
)
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.anotherai.dev/v1',  // Or http://localhost:8000/v1 for self-hosted
  apiKey: 'aai-***',  
});

// Your existing code works as-is
const response = await client.chat.completions.create({
  model: 'gpt-4o',
  messages: [
    { role: 'user', content: 'Hello, world!' }
  ],
  metadata: {
    agent_id: 'your-agent-name',  // Recommended for observability
  }
});

Verify your agent is working

Test your agent by running it once. If everything is set up correctly, you should see the completion appear at https://anotherai.dev/completions.

You're done!

Your agent is now integrated with AnotherAI, giving you access to:

  • 100+ AI Models: Access models from OpenAI, Anthropic, Google, and more
  • Real-time Observability: Monitor costs, performance, and errors
  • Prompt Deployments: Update prompts without code changes

Next Steps

Migrating from WorkflowAI to AnotherAI

For migrating agents from WorkflowAI to AnotherAI, see our comprehensive WorkflowAI Migration Guide. This guide covers:

  • Fetching prompts from WorkflowAI deployments
  • Converting WorkflowAI SDK calls to OpenAI completion calls
  • Setting up API keys and client configuration
  • Handling structured outputs and metadata

The migration process ensures your existing WorkflowAI agents work seamlessly with AnotherAI while gaining access to additional features.

Migrating Away from AnotherAI

We have a zero lock-in promise. If you're not happy with AnotherAI at any point, we make it easy to migrate away. Learn more here.

How is this guide?