← Back to Blog

How to Connect Dify to APIBox: Use Claude, Gemini & DeepSeek in Your Workflows

Step-by-step guide to connecting Dify to APIBox. Access Claude, GPT-5, Gemini, and DeepSeek through a single OpenAI-compatible endpoint—no region restrictions, at roughly 1/7 the official cost.

Dify is one of the most popular open-source platforms for building LLM-powered applications and workflows. But if you’re outside the US, accessing OpenAI, Anthropic, or Google APIs directly often means VPNs, foreign credit cards, and unreliable connections.

APIBox solves this with a single OpenAI-compatible endpoint that works anywhere, supports all major models, and costs roughly 1/7 of the official rates.

This guide walks you through the complete setup.

One: What You Need

  • A Dify account (self-hosted or dify.ai cloud)
  • An APIBox account with API key — register here
  • 5 minutes

Two: Get Your APIBox API Key

  1. Register at api.apibox.cc
  2. Go to API Keys in the dashboard and create a new key
  3. Copy the key — you’ll need it in the next step

APIBox endpoint: https://api.apibox.cc/v1

Three: Add APIBox as a Model Provider in Dify

Dify supports custom OpenAI-compatible providers. Here’s how to add APIBox:

Step 1: Open Model Provider Settings

In Dify, go to: Settings → Model Provider → Add Model

Or navigate to your workspace settings and find the Model Provider section.

Step 2: Select “OpenAI-Compatible”

In the provider list, choose OpenAI-Compatible (sometimes labeled as “Custom OpenAI” or “OpenAI API compatible”).

Step 3: Fill In the Configuration

FieldValue
Provider NameAPIBox (any name you choose)
API KeyYour APIBox API key
API Base URLhttps://api.apibox.cc/v1
Model NameSee list below

Step 4: Add Models

Add each model you want to use. Common choices:

Claude (Anthropic via APIBox):

  • claude-sonnet-4-6 — best balance of quality and speed
  • claude-opus-4-6 — highest quality, slower

GPT (OpenAI via APIBox):

  • gpt-5 — latest GPT
  • gpt-4o — fast and capable

Gemini (Google via APIBox):

  • gemini-2.5-pro — strong reasoning
  • gemini-flash — fastest, lowest cost

DeepSeek:

  • deepseek-v3 — excellent for Chinese content and code
  • deepseek-r1 — reasoning model

Step 5: Test the Connection

Click Test after entering each model. You should see a successful response confirming the connection works.

Four: Use APIBox Models in Your Dify Apps

Once configured, APIBox models appear in your model selector across Dify:

In Chatbots: Select your APIBox model from the model dropdown in the chatbot configuration.

In Workflows: Add an LLM node, choose your APIBox model. You can use different models for different nodes—for example, use gemini-flash for fast classification and claude-sonnet-4-6 for final response generation.

In Agent apps: Configure your agent to use any APIBox model as its backbone.

Five: Example Workflow — Multi-Model Pipeline

A typical cost-optimized Dify workflow using APIBox:

User Input

[Classification Node] — gemini-flash (fast, cheap)

[Branch: Simple query]     [Branch: Complex query]
       ↓                           ↓
[deepseek-v3]           [claude-sonnet-4-6]
       ↓                           ↓
         [Final Response]

This routes simple queries to cheaper models and complex ones to higher-quality models—all through a single APIBox key.

Six: Troubleshooting

“Connection failed” or “Invalid API key”

  • Double-check the API key is copied correctly with no extra spaces
  • Confirm the base URL is exactly https://api.apibox.cc/v1 (with /v1)

“Model not found”

  • Model names are case-sensitive. Use the exact names listed above.
  • Check your APIBox dashboard to confirm which models are available on your plan.

Slow responses

  • First requests may be slightly slower due to cold starts. Subsequent calls are faster.
  • For latency-sensitive workflows, use gemini-flash or deepseek-v3.

Usage not showing in dashboard

  • Refresh the APIBox dashboard. Usage is usually updated within a few minutes.

Seven: Cost Reference

APIBox charges at approximately 1/7 of official provider rates. Rough estimates:

ModelApprox. Cost (per 1M tokens)
claude-sonnet-4-6~¥3 input / ¥15 output
gpt-5~¥7 input / ¥21 output
gemini-flash~¥0.5 input / ¥1.5 output
deepseek-v3~¥2 input / ¥6 output

Recharge in RMB: ¥1 = $1 credit.

Eight: Summary

Connecting Dify to APIBox takes under 5 minutes and gives you access to all major LLMs through a single OpenAI-compatible endpoint—no VPN, no foreign payment methods, at roughly 1/7 the official cost.

Key configuration:

  • API Base URL: https://api.apibox.cc/v1
  • Auth: Bearer token with your APIBox API key
  • Models: claude-sonnet-4-6, gpt-5, gemini-2.5-pro, deepseek-v3, and more

Register for APIBox →

Try it now, add support after registration and send your account ID to claim ¥10 trial credit

Sign up free →