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

n8n - AI automated workflow platform

In n8n, connect to 58API through AI Agent and OpenAI Chat Model, and close the Responses API to complete compatible calls.

This tutorial uses the Chat Model route permanently

The main line is AI Agent → OpenAI Chat Model, and close Use Responses API. "Message a model" that does not use the OpenAI application node is used as a compatible access example.

n8n can connect models to triggers, agents, tools and business systems.

Preparation before use

  1. Log in 58API, create an API Key, and confirm that the balance is sufficient.
  2. Confirm 58API's https://api.58api.net/v1/models Can return the models available for the current account.
  3. Prepare an n8n instance of the current stable version.

Create a basic AI workflow

  1. Create a new Workflow in n8n.
  2. Added Chat Trigger.
  3. Add AI Agent and connect the Chat Trigger to the AI ​​Agent.
  4. Click the plus sign on the Chat Model port of the AI ​​Agent to add the OpenAI Chat Model child node.

AI Agent structure example in n8n official documentation (the trigger in the picture is Webhook, this tutorial uses Chat Trigger)

Create OpenAI credentials

Find Credential to connect with in the OpenAI Chat Model, choose to create a new OpenAI credential, and then fill in:

FieldFill in the content
API KeyYour 58API API Key
Organization IDLeave blank
Base URLhttps://api.58api.net/v1
Add Custom Headerclosure

58API configuration example of n8n OpenAI credential

The numbers in the picture are the order of filling in: enter the API Key, leave the Organization ID blank, and fill in the Base URL. https://api.58api.net/v1, close Custom Header, and then confirm that the connection test is successful.

Save and test the connection. n8n The current credential test will request:

GET https://api.58api.net/v1/models

So "Connection Test Failed" should first check the Base URL, API Key and /v1/models Is it accessible.

Select the model and close the Responses API

Return to the OpenAI Chat Model sub-node:

  1. Select in Model /v1/models The returned model.
  2. If the drop-down list does not show the target model, switch Model to ID mode and manually paste the exact model ID.
  3. Find Use Responses API and close it.

Must check Use Responses API

The current OpenAI Chat Model node (v1.3) has the Responses API enabled by default. Only the selected model explicitly supports /v1/responses can only be turned on when; this tutorial turns it off to make the call go to the /v1/chat/completions。

Do not write the Base URL as /v1/chat/completions. The node will append the Chat Completions path by itself according to the closed protocol.

Execution and verification

  1. Save the workflow.
  2. Open Chat Trigger's test chat window and send a simple text.
  3. Confirm that the AI ​​Agent returns normal content.
  4. Check the execution log of the AI ​​Agent / OpenAI Chat Model to confirm that there are no 404, 401 or HTML error pages.
  5. Open the 58API console usage log and check the model, time and request records.

The interface for n8n AI Agent to return results through OpenAI Chat Model

Why not use OpenAI application nodes as the main line?

n8n's OpenAI application node includes multiple operations such as text, pictures, videos, files, etc. Different operations will access different API paths. Credentials test passing only proves /v1/models Available does not mean that 58API supports every operation.

n8n official repository issue #21651 Record: OpenAI node v2’s “Message a model” passed the credential test under the custom Base URL, but returned 404 when running. The reason is that the node uses the Responses API by default (/responses); it will return to normal after closing Use Responses API. The OpenAI Chat Model node v1.3 also turns on the Responses API by default, so this tutorial requires turning it off and only using AI Agent → OpenAI Chat Model as the main line.

Verification Checklist

  • The OpenAI Chat Model subnode under AI Agent is used.
  • The Credential Base URL is https://api.58api.net/v1。
  • Credentials test to be able to access /v1/models。
  • Model The exact ID returned by 58API.
  • Use Responses API is closed.
  • The test conversation returns text, and the 58API usage log has corresponding records.

FAQ

The credential test is successful but returns 404 when run.

First confirm that you are using AI Agent → OpenAI Chat Model and close Use Responses API. Don't change directly to a guessed path; check the execution log for the actual endpoint.

Credentials test failed

n8n will call {Base URL}/models. Base URL should be https://api.58api.net/v1, the API Key must have access to the model list.

Model list is empty or has no target model

confirm /v1/models Return success. If only the target model does not appear in the drop-down box, use the Model ID pattern to manually fill in the exact model ID.

Return 401

Edit the OpenAI credential and re-paste the 58API API Key. The Organization ID generally does not need to be filled in, and the Custom Header should also be kept closed.

Can Responses API be opened?

Only the selected model supports Responses in the 58API model list (endpoints with openai-response) and then open it again. Just because one model is available does not mean that all models are available.

Can I use pictures, videos or Files operations directly?

It cannot be inferred from this tutorial that these operations are compatible. They are not Chat Completions routes and need to be independently verified for their respective endpoints, request bodies, and return formats.

official basis