Dify · Agent
Connect Dify to Tikway: an OpenAI-compatible provider and Agent checks
Last updated:
Dify can connect your AI application to Tikway through an OpenAI-compatible model provider. Configure the provider first, establish a simple Chatflow, then test an Agent tool flow. This sequence helps separate credentials and endpoint problems from tool execution issues.
1. Prepare the workspace, Key, and model
You need permission to manage model providers in your Dify workspace, a Tikway API Key, and a full text model ID from the model catalog. Agent tool calling requires explicit support from the selected model. Plain chat is a useful first check, but not a substitute for that capability.
The OpenAI-compatible Base URL is https://api.tikway.ai/v1. The full chat endpoint is https://api.tikway.ai/v1/chat/completions; use the Base URL field for the former.
This is a configuration and validation guide, not a claim of a completed end-to-end test with your Dify version, account, or model. Saving a model can trigger a short credential validation request. Provider tests, previews, and application runs also incur applicable model charges.
2. Add the OpenAI-compatible model provider
Open Settings → Model Providers in the Dify workspace and find OpenAI-API-compatible. If it is absent, find and install the official compatible provider plugin in the Marketplace model provider category, then return to settings. Check the publisher when choosing a plugin.
Add a custom model with the following values. The official plugin exposes API Base URL, API Key, and Function Call Type fields. Labels and placement can vary by Dify and plugin version.
| Setting | Value |
|---|---|
| Model Name | Full Tikway model ID, including its prefix and exact case |
| Model name for API endpoint | If you set this override, use the same full ID; if empty, the plugin uses Model Name |
| Model Type | LLM suitable for text chat |
| API Key | Key created in the Tikway console |
| API Base URL | https://api.tikway.ai/v1 |
| Completion Mode | Chat if this field is present, not the legacy Completion mode |
| Context and output limits | Match the selected model’s documented limits and the plugin fields |
| Function Call Type | Select Tool Call for the tool test; the default Not Support does not declare tool capability. Enable only for a supported model |
Save and send a short “Reply only with OK” test. Resolve provider connection errors before creating an Agent so that you can identify which layer fails.
3. Provider Keys and Dify application Keys are different
A Tikway API Key authorizes Dify to request Tikway models. Store it in the workspace’s model provider credentials.
A Dify application API Key authorizes a client to call your published Dify application. Use it in the frontend or service calling that Dify application. It cannot replace the provider Key or authorize a Tikway /v1/chat/completions request.
Verify the workflow inside Dify first, then integrate the published Dify application’s API. Those are separate connections.
4. Progress from Chatflow to an Agent
Create a basic Chatflow that connects user input to an LLM node and then an answer node. Select your new Tikway model in the LLM node and test a short prompt. This establishes the text path.
Next, select the model in an Agent or Agent node and choose a strategy supported by your installed version. Before choosing a Function Calling or tool-calling strategy, confirm support in both the model and provider plugin. A ReAct strategy also needs separate format and tool execution checks.
Attach a harmless arithmetic tool, such as a trusted Calculator tool or your own addition workflow tool. Give it only two integer inputs and a sum output. Set a clear description, then test “Use the addition tool to calculate 17 + 25, then report the result.” If the current version exposes a maximum iteration setting, start with 3.
5. Check the actual tool trace
In the preview, run details, or trace, verify that:
- The configured Tikway model was selected and generated a valid text response.
- The Agent requested the intended tool with the expected arguments.
- The tool executed successfully, returned
42, and its result entered the next model step. - The Agent finished without a repeated retry loop or exhausted iteration limit.
- Matching Tikway console records show the request, model ID, usage, and charges.
An answer containing “42” alone does not demonstrate tool execution. Saving provider credentials alone does not establish Agent compatibility.
6. Troubleshoot common failures
A 401 response: identify whether the failure comes from the Dify application API or the Tikway provider request. Check the appropriate Key, whitespace, saved workspace settings, and actual authentication header. See the 401 guide.
404 or HTML instead of a model response: inspect the final /v1/chat/completions path. Avoid duplicate /v1, duplicate /chat/completions, or the website’s business /api path.
A model is missing from a list: the compatible provider generally supports manual model configuration. Copy the full Tikway ID; do not replace it with a display name. A list-fetch error is different from a model request failure.
Chat works but the Agent fails: inspect model tool support, provider capability settings, Agent strategy, tool schema, arguments, and execution logs. Reduce the workflow to a single harmless tool first.
Unexpected costs: limit iterations, history length, and tool output size. Use the token cost calculator for per-request estimates and reconcile actual usage. One workflow can make multiple model requests.
Next: Agent API setup and model selection · LangChain tool calling · n8n AI Agent setup · model catalog
References: Dify model provider documentation · official OpenAI-compatible plugin fields. Plugin fields and Agent strategies change across versions; use the installed interface and run details to confirm behavior.