Skip to Content

Using 123API in Dify

Add 123API to Dify as an OpenAI-compatible or custom model provider.

Prerequisites

  1. Register a Dify account or prepare a self-hosted Dify instance
  2. Create a 123API API key
  3. Identify the model IDs you want to enable in Dify

Use Dify’s OpenAI provider with a custom base URL.

FieldValue
API KeyYour 123API key
API Base URLhttps://123api.co/v1

Alternative Method

You can also add 123API as a custom model provider and register each model separately.

Model Selection

Recommended starter set:

Enable only models that are actually supported by your 123API account and current routing setup.

After Configuration

  1. Create a new Dify application
  2. Choose the 123API-backed model in the orchestration page
  3. Run a few validation prompts before sending traffic to production
  1. Save the provider configuration
  2. Enable only one or two test models first
  3. Create a small Chatbot or Workflow app
  4. Verify prompt input, response output and token usage
  5. Expand the model set only after the first app is stable

FAQ

Dify cannot connect to 123API+

Confirm the Base URL includes /v1, your API key is valid and your Dify instance can reach https://123api.co.

A model is enabled but requests fail+

Dify may show a larger model list than your current 123API routing actually supports. Always validate model IDs through GET /v1/models.

Should I use OpenAI provider or custom provider?+

In most cases, OpenAI-compatible configuration is simpler. Use a custom provider only when you need separate management or more explicit per-model control.