AI Providers

Configure and manage multiple AI providers for maximum flexibility and performance

Supported AI Providers

PromptYap supports multiple AI providers, allowing you to choose the best model for each task. You can switch between providers seamlessly and even use different providers within the same sequence.

O

OpenAI

GPT-4, GPT-3.5, and other OpenAI models

A

Anthropic

Claude 3, Claude 2, and other Anthropic models

G

Google

Gemini Pro, Gemini Ultra, and other Google models

X

XAI

Grok and other XAI models

λ

Lambda

Lambda AI models and custom endpoints

Multi-Provider Benefits

  • Model Diversity: Choose the best model for each specific task
  • Cost Optimization: Use more affordable models when appropriate
  • Redundancy: Fallback options if one provider has issues
  • Performance: Compare outputs across different models
  • Specialization: Leverage each provider's unique strengths

Setup Overview

Setting up AI providers in PromptYap requires API keys from each provider you want to use. Here's the general process:

1

Obtain API Keys

Sign up with each AI provider and generate API keys

2

Configure Environment

Add API keys to your environment variables

3

Test Connection

Verify each provider is working correctly

4

Start Using

Select models when creating prompts and sequences

OpenAI Setup

1. Get Your API Key

  1. Visit platform.openai.com
  2. Sign up or log in to your account
  3. Navigate to API Keys in your account settings
  4. Click "Create new secret key"
  5. Copy the generated key (starts with "sk-")

2. Configure Environment Variable

Environment Variable
OPENAI_API_KEY=sk-your-openai-api-key-here

3. Available Models

GPT-4 Models

  • • gpt-4 - Most capable model
  • • gpt-4-turbo - Faster, more affordable
  • • gpt-4-32k - Extended context window

GPT-3.5 Models

  • • gpt-3.5-turbo - Fast and affordable
  • • gpt-3.5-turbo-16k - Extended context

OpenAI Best Practices

  • Use GPT-4 for complex reasoning and analysis tasks
  • Use GPT-3.5-turbo for simpler tasks to save costs
  • Monitor your usage to avoid unexpected charges
  • Set usage limits in your OpenAI dashboard

Anthropic Setup

1. Get Your API Key

  1. Visit console.anthropic.com
  2. Sign up or log in to your account
  3. Navigate to API Keys
  4. Click "Create Key"
  5. Copy the generated key

2. Configure Environment Variable

Environment Variable
ANTHROPIC_API_KEY=your-anthropic-api-key-here

3. Available Models

Claude 3 Models

  • • claude-3-opus - Most capable
  • • claude-3-sonnet - Balanced performance
  • • claude-3-haiku - Fast and efficient

Claude 2 Models

  • • claude-2.1 - Latest Claude 2
  • • claude-2.0 - Original Claude 2

Anthropic Best Practices

  • Claude excels at analysis, writing, and reasoning tasks
  • Use Claude 3 Opus for the most complex tasks
  • Claude 3 Haiku is great for simple, fast responses
  • Claude has strong safety features built-in

Google AI Setup

1. Get Your API Key

  1. Visit makersuite.google.com
  2. Sign in with your Google account
  3. Navigate to "Get API Key"
  4. Create a new API key
  5. Copy the generated key

2. Configure Environment Variable

Environment Variable
GOOGLE_API_KEY=your-google-api-key-here

3. Available Models

Gemini Models

  • • gemini-pro - Balanced performance and capability
  • • gemini-pro-vision - Supports image inputs
  • • gemini-ultra - Most capable (when available)

Google AI Best Practices

  • Gemini Pro offers excellent performance for most tasks
  • Use Gemini Pro Vision for tasks involving images
  • Google models are particularly good at factual tasks
  • Free tier available with generous limits

XAI & Lambda Setup

XAI (Grok)

Environment Variable

XAI_API_KEY=your-xai-api-key-here

Available Models

  • • grok-beta - XAI's flagship model
  • • grok-vision - Supports image inputs

Lambda AI

Environment Variable

LAMBDA_API_KEY=your-lambda-api-key-here

Custom Endpoints

Lambda supports custom model endpoints and specialized AI models.

Testing Your Setup

After configuring your API keys, test each provider to ensure they're working correctly:

1. Check Debug Endpoints

PromptYap includes debug endpoints to test each provider:

Debug URLs
/api/debug/models - List all available models
/api/debug/openai-test - Test OpenAI connection
/api/debug/anthropic-test - Test Anthropic connection
/api/debug/google-test - Test Google connection
/api/debug/xai-test - Test XAI connection

2. Create a Test Prompt

Create a simple prompt and test it with each provider:

Test Prompt
Write a haiku about artificial intelligence.

3. Verify Model Selection

Ensure all configured providers appear in the model dropdown when creating prompts.

Successful Setup

When everything is configured correctly, you should see:
  • All providers listed in the model selection dropdown
  • Debug endpoints returning successful responses
  • Test prompts executing without errors
  • Model responses appearing in your prompt runs

Choosing the Right Model

For Complex Analysis

  • OpenAI GPT-4: Best overall reasoning
  • Claude 3 Opus: Excellent for analysis
  • Gemini Ultra: Strong factual accuracy

For Creative Writing

  • Claude 3 Sonnet: Natural writing style
  • GPT-4: Creative and versatile
  • Grok: Unique perspective

For Speed & Cost

  • GPT-3.5 Turbo: Fast and affordable
  • Claude 3 Haiku: Quick responses
  • Gemini Pro: Good balance

For Specialized Tasks

  • Code: GPT-4, Claude 3
  • Math: GPT-4, Gemini Pro
  • Safety: Claude models

Troubleshooting

API Key Not Working

  • Verify the API key is correct and hasn't expired
  • Check that the environment variable name matches exactly
  • Restart your application after adding new environment variables
  • Ensure you have sufficient credits/quota with the provider

Models Not Appearing

  • Check that the provider's API key is configured
  • Verify the provider service is accessible from your network
  • Review the application logs for connection errors
  • Test the debug endpoints to isolate the issue

Rate Limiting Issues

  • Check your usage limits with each provider
  • Implement delays between requests if needed
  • Consider upgrading your plan for higher limits
  • Use different providers to distribute load