58API Help Center58API Help Center
User GuideAI ApplicationsAPI DocumentationHelp & Support

Dify - Visual AI application development platform

Access 58API through an OpenAI compatible model provider in Dify, and complete model configuration, conversation verification, and troubleshooting of common problems.

Scope of application

This tutorial applies to Dify Cloud and the current version of Dify self-hosted version. The main line is to access the 58API chat model through the official OpenAI-API-compatible model supplier plug-in.

Dify can visually orchestrate Chatflow, Workflow, knowledge base and Agent. Model credentials are shared across the workspace, so only the workspace owner or administrator can complete the provider configuration below.

This page is based on Dify model vendor documentationand OpenAI-API-compatible official plug-intidy.

Preparation before use

  1. Log in to 58API, create an API Key, and confirm that the account has available balance.
  2. Confirm the model ID to use. The model name must exactly match a model ID returned by the 58API /v1/models endpoint.
  3. Log in with your Dify workspace owner or administrator account.
  4. Self-hosted Dify recommends updating to the current stable version first and updating the model provider plugin.

Install model provider

  1. Go to Integrations → Model Suppliers on the left side of Dify.
  2. Search for OpenAI-API-compatible in the "Installation Model Supplier" area; if this page does not appear, you can open and install it from the Marketplace.
  3. After the installation is complete, return to the model supplier page and open the supplier card.
  4. Click Add Model.

Why not just choose OpenAI

58API uses an OpenAI compatible interface, but the API address is not the official OpenAI address. Custom interface addresses and model IDs can be filled in explicitly using the OpenAI-API-compatible plugin.

Add 58API chat model

Fill in the model information in the "Add OpenAI-API-compatible" window. Different Dify versions may display the address field as API endpoint URL or API Base URL, both of which fill in the same 58API base address.

58API configuration example for Dify OpenAI API compatible model

In the configuration shown in the image, select LLM, enter the exact model ID, API Key, and https://api.58api.net/v1, set Completion mode to Chat, and save. The example model is gpt-6.1-sol; in actual use, follow the model ID returned for the current account by /v1/models. Newer versions of the plug-in form may also show API Type (keep Chat Completions), Compatibility mode, Token parameters, and other fields. Use the recommended values below.

FieldFill in the contentillustrate
Model TypeLLMThis tutorial configures the chat model
Model NameExact model ID returned by the APIDo not enter a display name or abbreviate the ID
API KeyYour 58API API KeyDon’t show the full key in screenshots, tickets, or public documents
API endpoint URL / API Base URLhttps://api.58api.net/v1Fill in /v1 Root path, do not append any more /chat/completions
Completion modeChatUsing the Chat Completions message format
API TypeChat Completions API (/chat/completions)Keep the default; do not select Responses API (58API Gemini and other models are not supported)
Model context sizeModel real context lengthWhen unsure, check the model description and do not fill in extremely large values ​​arbitrarily.
Upper bound for max tokensModel true output upper limitThe value is not an account balance or total context length

It is recommended to configure the remaining capabilities in the most conservative way first:

  • Compatibility mode: First select the strict OpenAI compatibility mode (strict).
  • Token parameter: Use auto first.
  • Function Call Type (old version shows Function calling): Default is Not Support; only changes to Tool Call when the selected model supports tool calling.
  • Stream function calling: Enable only after confirming that the model also supports streaming tool calling.
  • Vision/Audio/Video/Document: These switches describe the model input capabilities and will not allow models that are not originally supported to automatically obtain corresponding capabilities.

After filling in, click Save. Dify will verify the credentials online; only if the verification is successful, the model will appear in the model list of applications and workflows.

Use in app

  1. Create a new basic chat application, or open an existing Chatflow/Workflow.
  2. Find the model you just added in the model selector of the LLM node.
  3. First use plain text prompt words to test, such as "Reply 58API connection successful".
  4. Run a preview to confirm that Dify returns normal text.
  5. Open the usage log of the 58API console and check whether corresponding request records appear at the same time.

Verify normal conversations first, then enable advanced abilities

Tool calls, structured output, visual input, and thinking content depend not only on the Dify switch, but also on the specific model. Successful normal dialogue does not mean that all advanced abilities are compatible.

Image understanding

Select a model with vision enabled (for example deepseek-v4.1-flash with a VISION tag), turn on Vision on the orchestration page, then upload an image in the chat box.

Knowledge Base and Embedding

When Dify knowledge base uses "high quality" indexing, the Text Embedding model needs to be configured separately. The chat model cannot replace the vector model. **Note: There is no Embedding (vector) model in the current public model list of 58API. ** you can:

  • When creating a knowledge base, select the Economic indexing method: use keyword retrieval, no Embedding model is required, but the retrieval accuracy is low; the 58API chat model is still used to generate answers. This can later be upgraded to a high-quality index in the knowledge base settings.
  • Or configure other Embedding providers separately for the Embedding of the knowledge base, and the chat (LLM) model continues to use 58API.

If the Embedding model is later put on 58API, you can add it like this:

  1. Back in the OpenAI-API-compatible provider, click Add Model.
  2. Select Text Embedding for Model Type.
  3. Use the same API Base URL, https://api.58api.net/v1 (the plug-in will request https://api.58api.net/v1/embeddings), and use a model name returned by /v1/models.
  4. After saving and validating, select the Embedding model in the Default Model in the upper right corner of the model supplier page.

The official plugin also supports Rerank, Speech2Text and TTS, each of which needs to be added and verified separately. API Base URL for all model types is filled in https://api.58api.net/v1: The current plug-in will be spliced ​​directly after the address. /chat/completions、/embeddings、/rerank、/audio/transcriptions、/audio/speech, will not be automatically compensated /v1. The third-party example in the plug-in README says that "non-LLM types are removed. /v1"Does not apply to 58API. After removing it, the request will be redirected to the official website and fail.

Verification Checklist

  • Credential verification passes when Dify saves the model.
  • The applied LLM node can select the newly added model.
  • Plain text tests return normal content instead of empty responses or HTML error pages.
  • 58 Call records of the same model and time appear in the API usage log.
  • If using the knowledge base: Economic indexing does not require Embedding; the Embedding model for high-quality indexing has been configured separately (other vendors are used when 58API does not have an Embedding model yet) and set as the default value.

FAQ

"Add Model" cannot be found or cannot be saved

Confirm that the current account is the workspace owner or administrator, and confirm that the OpenAI-API-compatible plug-in has been installed. Regular members cannot manage workspace model credentials.

Returns 401 Authentication failed

Copy the 58API API Key again and make sure there are no extra spaces, newlines or full-width characters. Do not fill in the login token for Codex, Claude, or other products.

Returns 404 or model does not exist

The API address should be https://api.58api.net/v1; do not append /chat/completions. Also check that the Model Name exactly matches a model ID returned by /v1/models.

Ordinary chat is normal, but tool calling fails.

First set the Function Call Type (the old version is Function calling) to Not Support, and turn off Stream function calling, and then confirm whether the model itself supports tool calling. Only enabled if both 58API and target model return standard tool call structure.

Old credentials not available after self-hosted version upgrade

Dify 1.14.x had an issue where OpenAI-compatible credentials were not available after migration, related official issue Closed. Old instances should update Dify and plug-ins first, and then re-verify or rebuild the model credentials; do not misjudge historical migration issues as 58API interface failures.

official basis