API Doc-ElkAPI
  1. Best Practices
API Doc-ElkAPI
  • Quick Start
    • Quick Start
    • Must-read for beginners
    • ElkAPI Announcement
  • API Reference
    • Error status code description
    • OpenAI Format
      • Veo3-chat format
      • seedance
      • response
      • generate video
      • image
      • Image Editing (gpt-image-1)
      • embed
      • Realtime
      • Get model list
      • Response ID to obtain results
      • Hunyuan3D
    • Anthropic Format
      • Anthropic Claude
    • Midjourney Image Generation
      • Quick teaching-complete process in one go
      • Task Query
        • pagination query
        • Specify ID to obtain task
      • Submit Imagine task
      • Submit video task
      • Submit editing task
      • Submit Action Task
      • Submit Blend task
      • Submit Describe task
      • Submit Modal
    • Image Generation
      • ideogram(images)
        • Official documentation (updated in real time)
        • Generate 3.0 (illustrated in the text)
        • Reframe 3.0 (Refactoring)
        • Replace Background 3.0
        • Remix 3.0 (Mixed Graph)
        • Edit 3.0 (Edit)
        • Generate (text and image)
        • Remix (mixed image)
        • Upscale (enlarged high-definition)
        • Describe
        • Edit
      • Flux(images)
        • Create Task - General
        • generate image
        • Fine tuning (temporarily unavailable)
        • query task
        • Generate image (replica format)
      • Replicate(image)
        • Create Task - General
        • Create task - float kontext pro, max
        • Create task-black forest labs/flux-1.1-pro
        • Create task-black forest labs/flux-1.1-pro ultra
        • query task
        • Create task
      • Recraft(images)
        • Generate Image
        • Vectorize Image
        • Remove Background
        • Clarity Upscale
        • Create style
        • Generative Upscale
    • Music Generation
      • Suno
        • Set suno version
        • Suno API Scenario Application Guide
        • Generate lyrics
        • Generate music
        • Upload music
        • Song Splicing
        • Full track acoustic separation
        • Single track acoustic separation
        • Create a new Persona
        • Query a single task
        • Generate MP4 MV video
        • Retrieve WAV format files
        • Timing: Lyrics, audio timeline
        • Batch query task
        • Create music using persona_id
      • Udio (not available yet)
        • Generate music
        • Query a single task
    • Video Generation
      • veo3
        • veo3-chat format
        • Submit video generation task
        • Check the video generation status
      • Dream Test
        • seedance
      • runway(video)
        • Official format
          • Generate videos from images
          • Get detailed task information
        • Reverse format
          • Generate (text)
          • Generate (refer to image)
          • Video2video video to video style redrawing
          • Act one emoji transfer
          • Feed - Get Task
      • kling (video)
        • Callback Protocol
        • image expansion
        • generate image
        • text-to-video
        • image-to-video
        • Video extension
        • Virtual try on
        • lip-sync
        • video effects
        • Query task (single)
      • luma (video)
        • Official API format
          • generate video
          • Single query task
      • MiniMax Conch (video)
        • Official Documentation
        • video generation
        • query task
        • File Download
      • PIKA(video)
        • Universal version
          • generate video
          • Query video tasks
        • Generate (reference video/extended video)
        • Generate (refer to image)
        • Generate (text)
        • feed
      • sora
        • Reverse format
          • Create video
          • Generate Video
          • Query video tasks
    • Audio
      • Text to audio conversion
      • audio to text
      • Create translation
  • Integration Guide
    • Best Practices
      • Claude code access instructions
      • ElkAPI Account Balance Query API Usage Instructions
      • Retry logic documentation using ElkAPI and OpenAI's official API
      • Midjorney Calling Best Practices
      • Runway Call Best Practices
    • Application Integration Guide
  • Pricing and Billing
    • About Price
    • About Grouping
  • Help Center
    • Help Center
    • Interface stability
    • Common Misconceptions
    • Use confusion
    • Privacy Policy
    • Terms of Service
  1. Best Practices

Claude code access instructions


💡 Preparation#

Before you begin, ensure your environment meets the following requirements:
Operating System: Windows 10/11, macOS 10.15+, Ubuntu 20.04+, or Debian 10+
Node.js: Version 18 or higher

Claude Code Installation and Usage Guide#

1️⃣ Install Node.js (skip if already installed)#

Note: Please ensure your Node.js version is ≥ 18.0

Windows Users#

Ubuntu / Debian Users#

macOS Users#


2️⃣ Install Claude Code#


3️⃣ Get started#

Step 1: Obtain configuration information#

Auth Token (ANTHROPIC_AUTH_TOKEN)
After registering, click Add Token on the API Token page to obtain one (starting with sk-).
The name is arbitrary. It's recommended to set the limit to unlimited. Keep all other settings as default.
API URL (ANTHROPIC_BASE_URL)
https://api.elkapi.com is the API service address for this site, the same as the main site address.

Step 2: Run Claude Code (temporary)#

Run the following command in your project directory. This method is only valid in the current terminal session.
After running it for the first time, follow the prompts to complete the initial setup:
Select your preferred theme + Enter
Confirm the security instructions + Enter
Use the default Terminal configuration + Enter
Trust the working directory + Enter
Now, start coding in the terminal with your AI coding partner! 🚀

4️⃣ Configure Environment Variables (Recommended)#

To avoid having to repeatedly enter the export command each time you launch Terminal, it's recommended to permanently save the environment variables to a configuration file.

Step 1: Write the Configuration#

Execute the following command to automatically append the configuration information to ~/.bash_profile, ~/.bashrc (for Bash), and ~/.zshrc (for Zsh).

Step 2: Restart the terminal and use#

Clearly close and reopen your terminal for the configuration to take effect. Afterwards, simply navigate to the project directory and run claude.

❓ FAQ#

Important Note: This site only serves as a forwarding proxy for the official Claude Code and cannot handle API requests from non-Claude Code.
Q: What should I do if I encounter an API error?
A: This may be caused by a temporary instability in the forwarding proxy network. Try exiting Claude Code (/quit or Ctrl+C) and trying again.
Q: What should I do if I encounter a login error on a webpage?
A: Try clearing your site-related cookies and logging in again.
Q: How do I resolve the error Invalid API Key · Please run /login?
A: This error indicates that Claude Code has not detected the ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL environment variables. Please return to [Step 4] (#4️⃣ - Configuring Environment Variables Recommended) to double-check that the environment variables are correctly configured and restart the terminal.
Q: Why does the status display offline?
A: Claude Code detects network status by attempting to connect to Google. Displaying offline simply indicates that it can't connect to Google. This does not affect your ability to use Claude Code's core functionality through this proxy.
Q: Why does browsing a webpage (Fetch) fail?
A: This is because before accessing a webpage, Claude Code first calls a native Claude service to determine whether the webpage is accessible. This native service requires an international internet connection (usually a global proxy) to function properly.
Q: Why do requests always display fetch failed?
A: This may be due to network issues in your region, preventing a stable connection to our proxy server. Try enabling the system proxy tool and trying again.
Previous
Create translation
Next
ElkAPI Account Balance Query API Usage Instructions
Built with