llm-integration

llm-integration is a skill for Claude Code, Codex from medy-gribkov/arcana. It costs 28 tokens per session (1,511 once invoked), scanned A, original, Apache-2.0.

A guide to connecting applications to OpenAI and Anthropic language-model APIs. It covers streamed responses, structured results, tool calls, token use, and API costs.

In plain words
What is it for?
Adding language-model features, validating API settings, handling streaming and structured output, calling tools, managing tokens, and controlling costs.
Why use it?
It helps avoid common integration problems such as exposed credentials, invalid configuration, excessive token use, and unreliable requests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Adding language-model features, validating API settings, handling streaming and structured output, calling tools, managing tokens, and controlling costs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/medy-gribkov/arcana/llm-integration
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 medy-gribkov/arcana --skill llm-integration
Clone the repo
git clone --depth 1 https://github.com/medy-gribkov/arcana

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin llm-integration/plugin install llm-integration after adding the marketplace above.

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 llm-integration

README.md
[![agentmods](https://agentmods.dev/badge/skills/medy-gribkov/arcana/llm-integration/github.svg)](https://agentmods.dev/skills/medy-gribkov/arcana/llm-integration)
Your own site
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/llm-integration"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/llm-integration/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 llm-integration

Your own site · 80×15
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/llm-integration"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/llm-integration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,511 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00028 $0.01511
Opus 5 $0.00014 $0.00756
Sonnet 5 $0.00006 $0.00302
Haiku 4.5 $0.00003 $0.00151

Measured 10d ago against content hash 81bbe84a4389, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

llm-integration scanned grade A with 0 findings 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 10d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/llm-integration/SKILL.md · 241 lines

How it starts

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

LLM Integration Skill

Integrate Large Language Models (OpenAI, Anthropic) into applications with proper streaming, structured outputs, tool calling, prompt engineering, token management, and error handling.

API Configuration and Client Setup

BAD: Hardcoded credentials, no validation

const openai = new OpenAI({
  apiKey: "sk-proj-abc123" // Hardcoded key
});

const anthropic = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY // No validation
});

GOOD: Environment validation, typed configuration

import OpenAI from 'openai';
import Anthropic from '@anthropic-ai/sdk';

interface LLMConfig {
  openaiKey?: string;
  anthropicKey?: string;
  maxRetries: number;
  timeout: number;
}

function validateConfig(config: LLMConfig): void {
  if (!config.openaiKey && !config.anthropicKey) {
    throw new Error('At least one API key (OPENAI_API_KEY or ANTHROPIC_API_KEY) required');
  }
  if (config.timeout < 1000) {
    throw new Error('Timeout must be at least 1000ms');
  }
}

const config: LLMConfig = {
  openaiKey: process.env.OPENAI_API_KEY,
  anthropicKey: process.env.ANTHROPIC_API_KEY,
  maxRetries: 3,
  timeout: 60000
};

validateConfig(config);

const openai = config.openaiKey ? new OpenAI({
  apiKey: config.openaiKey,
  maxRetries: config.maxRetries,
  timeout: config.timeout
}) : null;

const anthropic = config.anthropicKey ? new Anthropic({
  apiKey: config.anthropicKey,
  maxRetries: config.maxRetries,
  timeout: config.timeout
}) : null;

Streaming Responses

BAD: No streaming, blocks UI, no error handling

async function chat(prompt: string) {
  const response = await openai.chat.completions.create({
    model: 'gpt-4',
    messages: [{ role: 'user', content: prompt }]
  });
  return response.choices[0].message.content;
}

GOOD: Streaming with error handling and token tracking

async function* streamChat(
  prompt: string,
  onToken?: (token: string) => void
): AsyncGenerator<string, void, unknown> {
  try {
    const stream = await openai.chat.completions.create({
      model: 'gpt-4',
      messages: [{ role: 'user', content: prompt }],
      stream: true,
      stream_options: { include_usage: true }
    });

    let totalTokens = 0;

    for await (const chunk of stream) {
      const delta = chunk.choices[0]?.delta?.content;

      if (delta) {
        onToken?.(delta);
        yield delta;
      }

      if (chunk.usage) {
        totalTokens = chunk.usage.total_tokens;
      }
    }

    console.log(`Total tokens used: ${totalTokens}`);
  } catch (error) {
    if (error instanceof OpenAI.APIError) {
      throw new Error(`OpenAI API error (${error.status}): ${error.message}`);
    }
    throw error;
  }
}

// Usage
for await (const token of streamChat('Explain streaming', console.log)) {
  process.stdout.write(token);
}

Read the full file on GitHub · 241 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 241 lines · 28 tokens per session scan A 81bbe84a4389

Subscribe to this mod's changes

llm-integration is a skill published in the GitHub repository medy-gribkov/arcana (1 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,511 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

minimax

MiniMax M-series production wiring patterns for the OpenAI-compatible API at api.minimax.io. TRIGGERS - MiniMax, MiniMax-M2.7, Hailuo.

terrylica/cc-skills · 40 tokens

ai-orchestration-vercel-ai-sdk

Vercel AI SDK patterns - providers, text generation, streaming, structured output, tool calling, chat UI hooks, embeddings, and RAG.

agents-inc/skills · 38 tokens

openai-assistants-builder

Création d'assistants IA hébergés avec l'API OpenAI Assistants v2. File search avec vector stores, code interpreter, function calling, threads persistants et streaming. Se déclenche avec "OpenAI Assistants", "assistant API", "file search", "code interpreter", "thread", "run", "assistant OpenAI", "GPT assistant"…

khalilbenaz/claude-skills-collection · 116 tokens

mcp-server-builder

Création de serveurs MCP (Model Context Protocol) pour exposer des outils, ressources et prompts aux LLMs. Se déclenche avec "MCP", "Model Context Protocol", "MCP server", "MCP tool", "MCP resource", "serveur MCP", "connecter Claude à", "exposer une API à Claude", "claude desktop config". Also triggers on "build an…

khalilbenaz/claude-skills-collection · 105 tokens

arxiv

Search and download arXiv papers (no API key needed).

taracodlabs/aiden · 16 tokens

data-pipeline-pro

Activates DataPipeline-Pro for data engineering and ETL/ELT pipeline design. Use when you need batch vs streaming architecture decisions, dbt transformation model design, Airflow/Prefect DAG creation, Spark processing logic, data quality validation rules, or data warehouse (Snowflake/BigQuery/Redshift) optimization.

vignesh2027/Claude-Agentic-Skills2.0-version · 70 tokens