---
name: foundry-hermes
description: Use this skill when Hermes needs to connect an agent to Foundry Cloud, choose a live model, call chat completions, or handle a route failure.
---

# Foundry Cloud for Hermes

This skill is the Hermes recipe for the live Foundry model
`provider-scoped/arcee/deepseek/deepseek-v4-pro`. It was generated for the current registry-backed model
surface. Do not use it as a substitute for a fresh live registry check.

## Hermes handoff

- **Foundry API key:** read `FOUNDRY_API_KEY` from the Hermes secret store. This is the user-scoped Foundry key; do not print or commit it.
- **Foundry base URL:** set `FOUNDRY_BASE_URL` to `https://api.fdy.sh/v1`.
- **Selected model:** set `FOUNDRY_MODEL` to the exact live ID `provider-scoped/arcee/deepseek/deepseek-v4-pro`.
- **Tool convention:** Use the harness's HTTP/tool call with the exact model ID and return structured error status to the agent.
- **Paste this skill:** Add this file to the harness skill directory and expose the three environment variables through its secret store. The target is the harness skill directory.

These environment names are the explicit Foundry binding for this recipe. If
Hermes has a separate provider-native configuration slot, map that
slot to these values only when it can send Foundry's OpenAI-compatible request
shape. Do not assume a provider-native SDK, endpoint, or model alias.

# Foundry integration directions

This guide was generated from `rsi1-23f933a1295459b95d8f17b3089d771909f14c380fc5532b1128c7a777740305`. Refresh the live registry before choosing a different model or provider. Never replace unavailable registry data with a mock, seed, or guessed provider.

## 1. Configure the Foundry API

Foundry's API origin is `https://api.fdy.sh`. Use this OpenAI-compatible base URL and keep the API key in a secret environment variable:

```bash
export FOUNDRY_BASE_URL=https://api.fdy.sh/v1
export FOUNDRY_API_KEY="replace-with-your-foundry-api-key"
export FOUNDRY_MODEL='provider-scoped/arcee/deepseek/deepseek-v4-pro'
```

Create or manage a Foundry API key in the Foundry Console. Do not put the key in source control, a browser bundle, logs, or an agent prompt.

## 2. Refresh live model and provider data

List models from the live OpenAI-compatible catalog before selecting a model:

```bash
curl --fail-with-body --silent --show-error "$FOUNDRY_BASE_URL/models"
```

The Foundry Cloud integration surface loads the provider collection from the live Registry Intelligence V2 registry through its catalog route. The complete provider collection reported for this guide is:

- `ai21` — AI21 Labs (enabled; 0 routeable models; 0 executable offers)
- `aion_labs` — Aion Labs (enabled; 0 routeable models; 0 executable offers)
- `akashml` — AkashML (enabled; 0 routeable models; 0 executable offers)
- `ambient` — Ambient (enabled; 0 routeable models; 0 executable offers)
- `anthropic` — Anthropic (enabled; 0 routeable models; 0 executable offers)
- `arcee` — Arcee AI (enabled; 2 routeable models; 2 executable offers)
- `atlas_cloud` — Atlas Cloud (enabled; 0 routeable models; 0 executable offers)
- `avian` — Avian (enabled; 5 routeable models; 5 executable offers)
- `aws_bedrock` — AWS Bedrock (enabled; 0 routeable models; 0 executable offers)
- `baidu_qianfan` — Baidu Qianfan (enabled; 0 routeable models; 0 executable offers)
- `baseten` — Baseten (enabled; 0 routeable models; 0 executable offers)
- `black_forest_labs` — Black Forest Labs (enabled; 0 routeable models; 0 executable offers)
- `byteplus_modelark` — ByteDance Seed via BytePlus ModelArk (enabled; 0 routeable models; 0 executable offers)
- `cerebras` — Cerebras (enabled; 1 routeable models; 1 executable offers)
- `chutes_ai` — Chutes AI (enabled; 0 routeable models; 0 executable offers)
- `clarifai` — Clarifai (enabled; 0 routeable models; 0 executable offers)
- `cloudflare` — Cloudflare Workers AI (enabled; 0 routeable models; 0 executable offers)
- `cloudrift` — CloudRift (enabled; 0 routeable models; 0 executable offers)
- `cohere` — Cohere (enabled; 0 routeable models; 0 executable offers)
- `coreweave` — CoreWeave Serverless (W&B Inference) (enabled; 0 routeable models; 0 executable offers)
- `crusoe` — Crusoe Intelligence Foundry (enabled; 3 routeable models; 3 executable offers)
- `darkbloom` — Darkbloom (enabled; 0 routeable models; 0 executable offers)
- `databricks` — Databricks Model Serving (enabled; 0 routeable models; 0 executable offers)
- `decart` — Decart (enabled; 0 routeable models; 0 executable offers)
- `deepgram` — Deepgram (enabled; 0 routeable models; 0 executable offers)
- `deepinfra` — DeepInfra (enabled; 6 routeable models; 9 executable offers)
- `deepseek` — DeepSeek (enabled; 1 routeable models; 1 executable offers)
- `digitalocean` — DigitalOcean Inference (enabled; 0 routeable models; 0 executable offers)
- `eleven_labs` — ElevenLabs (enabled; 0 routeable models; 0 executable offers)
- `fal_ai` — Fal AI (enabled; 0 routeable models; 0 executable offers)
- `featherless` — Featherless AI (enabled; 0 routeable models; 0 executable offers)
- `fireworks` — Fireworks AI (enabled; 4 routeable models; 5 executable offers)
- `fish_audio` — Fish Audio (enabled; 0 routeable models; 0 executable offers)
- `friendli` — Friendli Model APIs (enabled; 2 routeable models; 2 executable offers)
- `gmicloud` — GMI Cloud (enabled; 0 routeable models; 0 executable offers)
- `google` — Google AI (enabled; 0 routeable models; 0 executable offers)
- `google_vertex` — Google Vertex AI (enabled; 0 routeable models; 0 executable offers)
- `groq` — Groq (enabled; 2 routeable models; 2 executable offers)
- `heygen` — HeyGen (enabled; 0 routeable models; 0 executable offers)
- `huggingface` — HuggingFace (enabled; 2 routeable models; 2 executable offers)
- `hyperbolic` — Hyperbolic (enabled; 0 routeable models; 0 executable offers)
- `inception` — Inception Labs (enabled; 0 routeable models; 0 executable offers)
- `inceptron` — Inceptron (enabled; 1 routeable models; 1 executable offers)
- `inference_net` — Inference.net (enabled; 3 routeable models; 3 executable offers)
- `infermatic` — Infermatic (enabled; 0 routeable models; 0 executable offers)
- `inflection` — Inflection AI (enabled; 0 routeable models; 0 executable offers)
- `io_net` — io.net IO Intelligence (enabled; 0 routeable models; 0 executable offers)
- `krea` — Krea (enabled; 0 routeable models; 0 executable offers)
- `mancer` — Mancer (enabled; 0 routeable models; 0 executable offers)
- `mara` — MARA Cloud (enabled; 0 routeable models; 0 executable offers)
- `meta` — Meta Model API (enabled; 0 routeable models; 0 executable offers)
- `minimax` — MiniMax (enabled; 0 routeable models; 0 executable offers)
- `minimax_music` — MiniMax Music (enabled; 0 routeable models; 0 executable offers)
- `mistral` — Mistral AI (enabled; 0 routeable models; 0 executable offers)
- `moonshot` — Moonshot AI (enabled; 0 routeable models; 0 executable offers)
- `morph` — Morph (enabled; 0 routeable models; 0 executable offers)
- `nebius` — Nebius Token Factory (enabled; 5 routeable models; 5 executable offers)
- `nextbit` — NextBit (enabled; 0 routeable models; 0 executable offers)
- `novita` — Novita AI (enabled; 0 routeable models; 0 executable offers)
- `nvidia` — NVIDIA NIM (enabled; 0 routeable models; 0 executable offers)
- `openai` — OpenAI (enabled; 1 routeable models; 1 executable offers)
- `openrouter` — OpenRouter (enabled; 7 routeable models; 7 executable offers)
- `parasail` — Parasail (enabled; 4 routeable models; 5 executable offers)
- `perceptron` — Perceptron (enabled; 0 routeable models; 0 executable offers)
- `perplexity` — Perplexity (enabled; 1 routeable models; 1 executable offers)
- `phala` — Phala Confidential AI (enabled; 3 routeable models; 3 executable offers)
- `poolside` — Poolside (enabled; 0 routeable models; 0 executable offers)
- `qwen` — Qwen (Alibaba DashScope) (enabled; 0 routeable models; 0 executable offers)
- `recraft` — Recraft (enabled; 0 routeable models; 0 executable offers)
- `reka` — Reka AI (enabled; 0 routeable models; 0 executable offers)
- `relace` — Relace (enabled; 12 routeable models; 14 executable offers)
- `replicate` — Replicate (enabled; 0 routeable models; 0 executable offers)
- `runway` — Runway (enabled; 0 routeable models; 0 executable offers)
- `sail_research` — Sail Research (enabled; 3 routeable models; 3 executable offers)
- `sakana` — Sakana AI (enabled; 0 routeable models; 0 executable offers)
- `sambanova` — SambaNova (enabled; 0 routeable models; 0 executable offers)
- `siliconflow` — SiliconFlow (enabled; 5 routeable models; 5 executable offers)
- `stepfun` — StepFun (enabled; 0 routeable models; 0 executable offers)
- `tencent_cloud` — Tencent Cloud Hunyuan (enabled; 0 routeable models; 0 executable offers)
- `together` — Together AI (enabled; 0 routeable models; 0 executable offers)
- `upstage` — Upstage (enabled; 0 routeable models; 0 executable offers)
- `venice` — Venice AI (enabled; 0 routeable models; 0 executable offers)
- `voyageai` — Voyage AI by MongoDB (enabled; 0 routeable models; 0 executable offers)
- `wafer` — Wafer Serverless (enabled; 0 routeable models; 0 executable offers)
- `xai` — xAI (enabled; 0 routeable models; 0 executable offers)
- `xiaomi` — Xiaomi MiMo (enabled; 0 routeable models; 0 executable offers)
- `z_ai` — Z.AI (enabled; 1 routeable models; 1 executable offers)
- `zhipu` — Zhipu AI (enabled; 0 routeable models; 0 executable offers)

The selected model is `provider-scoped/arcee/deepseek/deepseek-v4-pro` from the `DeepSeek` lab. Its live provider IDs are: `arcee` (Arcee AI). Use the exact canonical model ID returned by the live catalog; do not infer an ID from its display name. The selected model is currently routeable.

If live model or provider discovery fails, returns a non-success response, returns invalid JSON, or is not marked as live by the Foundry catalog surface, stop and surface the failure. Do not fall back to an embedded catalog.

## 3. Call chat completions

Send an OpenAI-compatible request: POST https://api.fdy.sh/v1/chat/completions. Include the Foundry key:

```bash
curl --fail-with-body --silent --show-error "$FOUNDRY_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $FOUNDRY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "provider-scoped/arcee/deepseek/deepseek-v4-pro",
  "messages": [
    {
      "role": "user",
      "content": "Hello from Foundry"
    }
  ]
}'
```

Equivalent JavaScript/TypeScript request:

```ts
const response = await fetch(`https://api.fdy.sh/v1/chat/completions`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FOUNDRY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "provider-scoped/arcee/deepseek/deepseek-v4-pro",
    messages: [{ role: "user", content: "Hello from Foundry" }],
  }),
});

if (!response.ok) {
  throw new Error(`Foundry request failed with HTTP ${response.status}`);
}

const completion = await response.json();
```

## 4. Handle errors without hiding registry truth

- **401 or 403:** verify that the key exists, is active, and is being sent as a Bearer token. Never print the key while debugging.
- **404:** refresh the live model catalog. The requested model or route may no longer be available; do not silently substitute another model.
- **429:** respect `Retry-After` when present and use a bounded retry policy. Surface the error when the retry budget is exhausted.
- **5xx or network failure:** treat the request as failed, preserve any Foundry request ID, and retry only under the caller's safety/idempotency policy with a bounded backoff.
- **Any other non-2xx or malformed JSON:** stop, return the status and safe response details, and do not claim that the completion succeeded.

## 5. Agent handoff checklist

1. Load the current live model and provider registry.
2. Pick an explicitly routeable model and preserve its exact canonical ID.
3. Read `FOUNDRY_API_KEY` from the runtime secret store.
4. Call `/v1/chat/completions` with the Bearer key.
5. Keep provider selection and model availability source-backed; if the live registry is unavailable, fail closed.

