## Nebius AI Setup

AI Processing: LogoAIpro uses Nebius AI to power logo generation. Nebius AI provides access to state-of-the-art AI models (Flux Schnell and Flux Dev) for creating professional, unique brand identities.

## What is Nebius AI?

Nebius AI is a platform that provides access to advanced AI models for image generation. LogoAIpro uses Nebius AI to:

- Generate Logos: Create professional, unique brand identities from text prompts
- Multiple Styles: Support for 6 design styles (Minimal, Technology, Corporate, Creative, Abstract, Flashy)
- Customization: Control colors, sizes, and quality settings
- Fast Generation: Optimized models for quick logo creation

##
Step-by-Step Setup

### Step 1: Create Nebius AI Account

1. Go to nebius.ai
2. Click "Sign Up" or "Get Started"
3. Sign up with your email address or preferred method
4. Verify your email address (if required)
5. Complete the onboarding process

### Step 2: Get Your API Key

1. After signing in, navigate to API Keys or Settings
2. Click on Create API Key or Generate New Key
3. Give your API key a name (e.g., "LogoAIpro Production")
4. Copy the API key immediately (you won't be able to see it again)
5. Add it to your `.env.local` file:

       NEBIUS_API_KEY=your-api-key-here

Security Note: Never share your API key or commit it to version control. Keep it secure in your `.env.local` file. Store it safely as you won't be able to view it again after creation.

### Step 3: Configure Project/Organization (if required)

Some Nebius AI setups require a project ID or organization ID:

1. Navigate to your Nebius AI dashboard
2. Find your Project ID or Organization ID in the settings
3. Add it to your `.env.local` file if required:

       NEBIUS_PROJECT_ID=your-project-id
       NEBIUS_ORGANIZATION_ID=your-org-id

##
Models Used by LogoAIpro

### Primary Models: Flux Schnell & Flux Dev

LogoAIpro uses two AI models for logo generation:

- Flux Schnell: Optimized for realistic and detailed logos with fast generation times
- Flux Dev: Advanced model for enhanced realism and complex designs

    Model Options:
    - Flux Schnell: Fast generation, optimized for logos
    - Flux Dev: Enhanced quality, more detailed results

    Primary Use: Logo generation with 6 design styles
    Output Format: PNG/JPG
    Sizes: 256x256, 512x512, 1024x1024
    Quality: Standard, HD

### Model Configuration

LogoAIpro is configured with:

- Output Format: PNG (for transparency support) or JPG
- Size Options: 256x256, 512x512, 1024x1024 pixels
- Quality Settings: Standard and HD options
- Design Styles: 6 professional styles (Minimal, Technology, Corporate, Creative, Abstract, Flashy)
- Color Customization: Primary and background color options

##
Pricing & Credits

Nebius AI Pricing:

- Nebius AI charges per API call or based on compute usage
- Costs vary by model (Flux Schnell vs Flux Dev) and generation time
- LogoAIpro deducts credits from user accounts based on logo generation
- Each logo generation typically costs 1 credit per operation

### Credit Costs

Operation | Credits per Operation
--- | ---
Logo Generation (Flux Schnell) | 1 credit
Logo Generation (Flux Dev) | 1 credit
Logo Regeneration | 1 credit

##
Testing Nebius AI API

### Test API Connection

1. Ensure your `NEBIUS_API_KEY` is set in `.env.local`
2. Start your development server: `npm run dev`
3. Navigate to the logo generation page (`/dashboard/generate` or `/generate`)
4. Try generating a logo with different styles and settings
5. Check the browser console and server logs for any errors

### Common Issues

#### Issue: "Nebius API key is not configured"

Solution:

- Verify `NEBIUS_API_KEY` is set in `.env.local`
- Restart your development server after adding the key
- Check that the key is correctly formatted (no extra spaces or quotes)
- Ensure the key hasn't expired or been revoked

#### Issue: "Failed to generate logo"

Solution:

- Check your Nebius AI account has sufficient credits/balance
- Verify your API key is valid and active
- Check Nebius AI status page for service issues
- Review server logs for detailed error messages
- Verify your project/organization ID is correct (if required)

#### Issue: "Rate limit exceeded"

Solution:

- Upgrade your Nebius AI account for higher rate limits
- Implement request throttling in your application
- Wait before making additional requests
- Check your current usage in the Nebius AI dashboard

#### Issue: "Invalid model or endpoint"

Solution:

- Verify the model names (Flux Schnell, Flux Dev) are correct
- Check that the API endpoint URLs are up to date
- Review Nebius AI documentation for any API changes
- Ensure you're using the correct API version

##
Security Best Practices

Security Recommendations:

- Never Expose Key: Keep your API key server-side only
- Use Environment Variables: Never hardcode keys in your code
- Separate Test/Prod: Use different keys for development and production
- Monitor Usage: Regularly check Nebius AI dashboard for unusual activity
- Rotate Keys: Periodically rotate your API keys for security
- Set Usage Limits: Configure spending limits in Nebius AI dashboard

##
Monitoring & Analytics

### Nebius AI Dashboard

Monitor your API usage in the Nebius AI Dashboard:

- Usage: Track API calls and compute usage
- Billing: Monitor costs and set spending limits
- API Keys: Manage and rotate your API keys
- Projects: Organize and manage your projects
- Logs: View API request logs and errors

##
Verification Checklist

Ensure you have:

- Nebius AI account created
- API key generated and added to `.env.local`
- Project/Organization ID configured (if required)
- Tested API connection with a simple logo generation
- Verified credits are being deducted correctly
- Checked Nebius AI dashboard for successful API calls

Next Steps: After Nebius AI is configured:

- Complete Environment Variables Setup
- Learn how to use logo generation
- Configure pricing and credits
- Set up MongoDB for storing generated logos