""" API key creation guide component """ import gradio as gr def create_api_guide(): """Create API key creation guide with expandable sections""" with gr.Accordion("Need help creating API keys?", open=False): gr.Markdown("### Step-by-Step API Key Creation Guide") with gr.Tabs(): # Groq API Key Guide with gr.Tab("Groq API Key"): groq_guide = '''

Creating a Groq API Key

  1. Go to Groq Console
  2. Sign up or log in to your account
  3. Navigate to API Keys section
  4. Click on Create API Key
  5. Give your key a descriptive name
  6. Copy the generated key (starts with gsk_)
  7. Paste it in the Groq API Key field above
info

Keep your API key secure and never share it publicly.

Additional Resources:
''' gr.HTML(groq_guide) # Hugging Face Token Guide with gr.Tab("Hugging Face Token"): hf_guide = '''

Creating a Hugging Face Token

  1. Go to Hugging Face
  2. Sign up or log in to your account
  3. Click on your profile picture → Settings
  4. Navigate to Access Tokens
  5. Click on New Token
  6. Select token type: Write
  7. Give your token a descriptive name
  8. Copy the generated token (starts with hf_)
  9. Paste it in the Hugging Face Token field above
warning

Write token is required for creating and updating Spaces.

Additional Resources:
''' gr.HTML(hf_guide) # Best Practices with gr.Tab("Best Practices"): practices_guide = '''

API Key Security Best Practices

lock
Key Rotation

Regularly rotate your API keys (every 90 days recommended).

visibility_off
Never Expose Keys

Never commit API keys to version control or share in public forums.

shield
Use Environment Variables

Store keys in environment variables instead of hardcoding.

notifications
Monitor Usage

Regularly check API usage and set up alerts for unusual activity.

delete
Revoke Unused Keys

Immediately revoke keys that are no longer needed.

''' gr.HTML(practices_guide) return None