opencode-server-api

opencode-server-api is a skill for Claude Code, Codex from kevinlin/cowork-z. It costs 0 tokens per session (1,790 once invoked), scanned A, original, MIT.

A guide for using the OpenCode server's REST API, which is a way for software to request information and actions over HTTP. It focuses on inspecting server health, sessions, messages, todos, settings, skills, and connected MCP services.

In plain words
What is it for?
Use it to check server status, review session history, inspect tasks and configuration, see available skills or connected services, and apply lightweight settings updates.
Why use it?
It gives an agent a defined way to inspect its own working state and make small configuration changes without guessing which API requests are available.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

Good fit Use it to check server status, review session history, inspect tasks and configuration, see available skills or connected services, and apply lightweight settings updates.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kevinlin/cowork-z/opencode-server-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kevinlin/cowork-z --skill opencode-server-api
Clone the repo
git clone --depth 1 https://github.com/kevinlin/cowork-z

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for opencode-server-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/kevinlin/cowork-z/opencode-server-api/github.svg)](https://agentmods.dev/skills/kevinlin/cowork-z/opencode-server-api)
Your own site
<a href="https://agentmods.dev/skills/kevinlin/cowork-z/opencode-server-api"><img src="https://agentmods.dev/badge/skills/kevinlin/cowork-z/opencode-server-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for opencode-server-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/kevinlin/cowork-z/opencode-server-api"><img src="https://agentmods.dev/badge/skills/kevinlin/cowork-z/opencode-server-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,790 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 10
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01790
Opus 5.5 $0.00000 $0.00716
Sonnet 5.5 $0.00000 $0.00358
Haiku 4.5 $0.00000 $0.00179

Measured 1mo ago against content hash 0e6284275f53, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

opencode-server-api scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -u "opencode:$OPENCODE_SERVER_PASSWORD" http://localhost:$PORT/<endpoint>
src-tauri/resources/skills/opencode-server-api/SKILL.md · 256 lines

How it starts

The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenCode Server API

This skill gives you access to the OpenCode server REST API for self-introspection — checking your own health, session state, message history, todos, configuration, skills, MCP status, and performing lightweight config updates.

Authentication

The server port is provided in your system prompt inside the <server-access> block. The basic-auth password is already present in your shell environment as OPENCODE_SERVER_PASSWORD — your shell expands it locally when you run a command. All requests require HTTP basic auth:

curl -s -u "opencode:$OPENCODE_SERVER_PASSWORD" http://localhost:$PORT/<endpoint>

Replace $PORT with the port from your system prompt. Use $OPENCODE_SERVER_PASSWORD exactly as written (PowerShell: $env:OPENCODE_SERVER_PASSWORD).

NEVER print, echo, log, or write the password's value anywhere — not to the chat, not to files, not to command output. Only reference it as a shell variable inside commands.

IMPORTANT: Fetch the API Spec First

Before calling ANY specific endpoint, you MUST first fetch and parse the live OpenAPI specification. The spec is the source of truth for all available endpoints, request/response schemas, and query parameters. The endpoint summaries in this skill are a convenient reference, but the server's own spec may be newer or more complete.

curl -s -u "opencode:$OPENCODE_SERVER_PASSWORD" http://localhost:$PORT/doc

This returns the full OpenAPI JSON spec. Parse it to understand the exact request format, required parameters, and response shapes before invoking any endpoint. Do not guess or rely solely on the examples below — always verify against /doc first.


Endpoint Reference

GET /global/health

Check server health and get the OpenCode version.

curl -s -u "opencode:$OPENCODE_SERVER_PASSWORD" http://localhost:$PORT/global/health

Response:

{ "healthy": true, "version": "1.1.48" }

GET /config

Read the current server configuration (model, agents, permissions, MCP servers, etc.).

Read the full file on GitHub · 256 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 256 lines · 0 tokens per session scan A 0e6284275f53

Subscribe to this mod's changes

opencode-server-api is a skill published in the GitHub repository kevinlin/cowork-z (13 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,790 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

claude-api

Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports anthropic/@anthropic-ai/sdk/claudeagentsdk, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports openai/other AI SDK, general programming, or ML/data-science tasks.

PM-Shawn/Abu-Cowork · 84 tokens

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

PM-Shawn/Abu-Cowork · 61 tokens

Forsion Connect AI SDK

Build web pages/apps that call Forsion's AI (LLM chat, server-managed agent conversations with web search, image generation) using the signed-in Forsion account — one script tag, no API keys. Use this whenever the user wants a website or HTML page with any AI feature (smart import/parsing, chatbot/assistant, AI…

Changan-Su/Forsion · 168 tokens

dws

A command-line guide for DingTalk, a workplace platform with chat, documents, calendars, approvals, tasks, and other business tools.

Pinvou/pinvou-agent · 193 tokens

government-writing

A skill for writing formal Chinese government documents, including notices and opinions, in the required official format.

Pinvou/pinvou-agent · 133 tokens

wecomcli-pptx

A tool for creating, editing, and importing presentations as online WeCom slide documents. WeCom is an enterprise collaboration platform.

Pinvou/pinvou-agent · 153 tokens