Use DeepSeek in Hermes Agent.
DeepSeek V4 supports both OpenAI chat completions and Anthropic messages protocols through RunAPI. Hermes Agent connects via the custom:runapi provider — same base URL and key you use for other models. Activate reasoning mode with a request parameter. RunAPI prices DeepSeek at 50% of official rates.
Use RunAPI to call DeepSeek V4 Pro through Hermes Agent's custom:runapi provider.
Requirements:
- Use the custom:runapi provider already configured in Hermes Agent
- Call the RunAPI chat completions endpoint at https://runapi.ai/v1/chat/completions
- Set model to "deepseek-v4-pro"
- The RUNAPI_API_KEY environment variable provides authorization
- The response streams back as SSE events in OpenAI chat completions format
- To enable reasoning, set thinking.type to "enabled" in the request body
curl -X POST https://runapi.ai/v1/chat/completions \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a Python function that finds the longest palindromic substring in O(n) time using Manacher algorithm."}
],
"stream": true,
"max_tokens": 4096
}'
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "deepseek-v4-pro",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is Manacher's algorithm implementation..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 356,
"total_tokens": 398
}
}
Use DeepSeek in Hermes Agent in three steps
Configure RunAPI provider
Set the RUNAPI_API_KEY environment variable. If you already added RunAPI as custom:runapi in Hermes Agent, the same provider and key work for DeepSeek — no extra configuration. If not, add RunAPI with base_url https://runapi.ai/v1 and api_mode chat_completions.
export RUNAPI_API_KEY=runapi_xxx
Select a DeepSeek model
Switch the model to deepseek-v4-pro for quality or deepseek-v4-flash for speed. Both use the /v1/chat/completions endpoint through the custom:runapi provider. Enable reasoning by passing thinking.type set to enabled — no separate model entry needed.
model: deepseek-v4-pro
Stream the response
Hermes Agent receives the response as an SSE stream in OpenAI chat completions format. Token usage appears in the final event. Switch between DeepSeek, GPT, and Claude models without changing the provider config — only the model field changes.
stream: true
DeepSeek chat completions parameters
| Parameter | Type | Description |
|---|---|---|
model |
string |
Required. deepseek-v4-pro or deepseek-v4-flash. |
messages |
array |
Required. Array of message objects with role (system, user, assistant) and content fields. |
stream |
boolean |
Optional. Set to true for SSE streaming. Default false. |
max_tokens |
integer |
Optional. Maximum number of tokens to generate. |
temperature |
number |
Optional. Sampling temperature between 0 and 2. Lower values are more deterministic. |
thinking |
object |
Optional. Set type to "enabled" to activate DeepSeek's built-in reasoning mode. |
What is DeepSeek on Hermes Agent?
DeepSeek V4 is a budget-friendly LLM that works through both OpenAI and Anthropic protocol surfaces on RunAPI. Hermes Agent calls it through the same custom:runapi provider used for GPT and Claude -- just change the model parameter. Built-in reasoning mode activates with a request parameter, and RunAPI prices DeepSeek at 50% of the already-low official rates, making it the cheapest reasoning-capable model available through a single API key.
DeepSeek use cases
Self-hosting alternative evaluation
Test DeepSeek through RunAPI's API before deciding whether to self-host the open-source weights. If API costs stay below your infrastructure break-even, keep using the hosted version. If volume justifies it, deploy locally with the same model.
Building reasoning UIs that show chain-of-thought
Enable thinking mode and display the thinking tokens in your UI so users can see how the model worked through a problem. Useful for tutoring apps, code debugging tools, or decision support systems.
High-volume batch processing at minimum cost
Run DeepSeek Flash for fast, cheap processing of large document sets, classification tasks, or data extraction jobs where per-token cost matters more than peak quality.
DeepSeek + Hermes Agent questions
Yes. If you already have custom:runapi configured in Hermes Agent, switch the model to deepseek-v4-pro or deepseek-v4-flash. The base URL, API key, and api_mode stay the same. Use hermes model or edit the config file directly.
When you enable reasoning (thinking.type set to enabled), DeepSeek generates additional "thinking" tokens that show its chain-of-thought process. These tokens count as output tokens and are billed accordingly. They improve accuracy on complex tasks but increase total token usage.
Self-hosting requires significant GPU infrastructure (80GB+ VRAM for the full model). Through RunAPI at 50% of DeepSeek's already low rates, most teams save money on the API until they hit very high sustained volume. Start with the API and evaluate self-hosting once your monthly token spend justifies the hardware cost.
Pass thinking.type set to enabled in the request body. Reasoning mode is a request parameter, not a separate model. The reasoning tokens are billed as output tokens. This works through both the OpenAI and Anthropic protocol surfaces.
RunAPI prices DeepSeek tokens at 50% of official DeepSeek rates. Since DeepSeek already undercuts GPT and Claude on per-token cost, this makes it the lowest-priced reasoning-capable LLM available through a single API. No subscription, no minimum — pay per token.
Configure the provider type in Hermes Agent. Use the OpenAI-compatible provider for chat completions format, or the Anthropic-compatible provider for messages format. Both route through RunAPI to the same DeepSeek models.
Yes. Set the model parameter in each request to the desired variant. Hermes Agent can route quick tasks to Flash and complex reasoning to Reasoner, all through the same custom:runapi provider and API key.
Hermes Agent general setup
Not configured yet? Start with the RunAPI setup guide for Hermes Agent.
Hermes Agent setup guide →Try DeepSeek in Hermes Agent today.
Get a free RunAPI key, set the model to deepseek-v4-pro in Hermes Agent, and start reasoning at half the cost of direct DeepSeek access.