Reactive Agents

OpenAI Provider

Complete guide to using OpenAI with Reactive Agents, including configuration, authentication, and advanced features

Reactive Agents provides seamless integration with OpenAI's API, supporting Chat Completions, Embeddings, Image Generation, Audio APIs, and more.

Authentication & Configuration

Setup

  1. Get your OpenAI API key from OpenAI Platform
  2. Add your API key in the Reactive Agents dashboard under AI Providers
  3. Configure your preferred OpenAI models in the Models section

Basic Usage

const response = await fetch('http://localhost:3000/v1/chat/completions', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.BEARER_TOKEN ?? 'reactive-agents'}`,
    'Content-Type': 'application/json',
    'ra-config': JSON.stringify({
      agent_name: 'openai-agent',
      skill_name: 'chat-completion',
      strategy: { mode: 'single' },
      targets: [{ optimization: 'auto' }]
    })
  },
  body: JSON.stringify({
    model: 'gpt-5',
    messages: [
      { role: 'user', content: 'Hello, how can you help me?' }
    ]
  })
});

Troubleshooting

Authentication Errors (401): Verify your API key is correct and has sufficient credits Rate Limit Errors (429): Reactive Agents automatically handles retries; consider upgrading your OpenAI plan Model Not Found (404): Verify the model name is correct and your account has access