import React, { useState } from 'react'; import { FiExternalLink, FiCheck, FiCopy, FiEye, FiEyeOff, } from 'react-icons/fi'; import Typography from './Typography'; import { Button } from './Button'; interface ApiKeyGuideProps { provider: 'openai' | 'anthropic'; onClose?: () => void; } interface StepProps { stepNumber: number; title: string; isCompleted?: boolean; children: React.ReactNode; } const Step: React.FC = ({ stepNumber, title, isCompleted = false, children, }) => { return (
{isCompleted ? : stepNumber}
{title}
{children}
); }; const OpenAIGuide: React.FC = () => { const [showApiKey, setShowApiKey] = useState(false); const handleCopyApiKey = () => { navigator.clipboard.writeText('sk-your-api-key-here'); }; return (
First, you'll need to create an account with OpenAI if you don't already have one. Sign up for OpenAI You'll need to verify your email address and phone number.
OpenAI requires a payment method to use their API. Don't worry - you only pay for what you use, and new accounts get $5 in free credits.
💡 Tip: Set up usage limits in your billing settings to avoid unexpected charges. You can set a monthly limit as low as $5.
Go to Billing Settings
Navigate to the API Keys section and create a new key.
Open API Keys Page
1. Click "Create new secret key" 2. Give it a descriptive name (e.g., "Hedera Agent") 3. Copy the key immediately - you won't see it again!
Your API key will look like this:
{showApiKey ? 'sk-abc123def456ghi789jkl012mno345pqr678stu901vwx234yz567890' : 'sk-•••••••••••••••••••••••••••••••••••••••••••••••••••'}
⚠️ Important: Keep your API key secure! Never share it publicly or commit it to version control. This app stores it securely in your system keychain.
Now paste your API key in the "API Key" field below. The app will validate it and test the connection for you.
); }; const AnthropicGuide: React.FC = () => { const [showApiKey, setShowApiKey] = useState(false); return (
Sign up for an Anthropic account to access Claude's API. Sign up for Anthropic You'll need to verify your email address and phone number.
Anthropic uses a prepaid credit system. You'll need to purchase credits before you can use the API.
💡 Tip: Start with $20-50 in credits. Claude 3.5 Haiku is very cost-effective for most tasks.
Add Credits
Create a new API key from the Anthropic console.
Open API Keys Page
1. Click "Create Key" 2. Give it a name (e.g., "Hedera Agent") 3. Copy the key immediately - you won't see it again!
Your Anthropic API key will look like this:
{showApiKey ? 'sk-ant-api03-abc123def456ghi789jkl012mno345pqr678stu901vwx234yz567890' : 'sk-ant-•••••••••••••••••••••••••••••••••••••••••••••••••••••••'}
⚠️ Important: Anthropic API keys start with "sk-ant-". Keep your key secure and never share it publicly.
Now paste your API key in the "API Key" field below. The app will validate it and test the connection for you.
); }; export const ApiKeyGuide: React.FC = ({ provider, onClose, }) => { return (
🔑 How to Get Your {provider === 'openai' ? 'OpenAI' : 'Anthropic'}{' '} API Key {onClose && ( )}
Follow these step-by-step instructions to get your API key. Don't worry - it's easier than it looks!
{provider === 'openai' ? : }
Need Help? If you run into any issues, check the{' '} {provider === 'openai' ? 'OpenAI' : 'Anthropic'} documentation or contact their support team. Most issues are related to billing setup or account verification.
); };