Integrating Agnes AI Free Tokens with Claude Code for Multimodal Tasks

This article walks through connecting the free Agnes AI multimodal API to Claude Code, detailing the required setup, a small Java code‑generation task, image and video generation examples, skill creation, and performance observations to help developers evaluate its suitability for their workflows.

JavaGuide
JavaGuide
JavaGuide
Integrating Agnes AI Free Tokens with Claude Code for Multimodal Tasks

Connecting Claude Code to Agnes AI

Obtain an Agnes API key from https://platform.agnes-ai.com/, install CC Switch from https://github.com/farion1231/cc-switch/releases, and add a custom vendor in Claude Code pointing to https://apihub.agnes-ai.com/v1 with model agnes-2.0-flash. Add a compatibility JSON in CC Switch to allow the thinking and context_management parameters and drop all others.

Enable the CC Switch route, then send a test prompt such as “请用 5 句话解释 Java 中 HashMap 扩容为什么可能影响性能。” Claude Code returns a response, confirming that requests are routed to agnes-2.0-flash.

Running a Small Code Generation Task

Prompt Claude Code to create a Java command‑line tool named MarkdownImageChecker that scans a directory for *.md files, extracts image links from Markdown and HTML syntax, resolves local paths relative to each file, checks file existence, and outputs a table with file path, line number, image URL, and status. The generated source file, compilation command ( javac MarkdownImageChecker.java) and execution command ( java MarkdownImageChecker [directory]) were produced. The end‑to‑end execution took about 1 minute 33 seconds, demonstrating acceptable latency for a first‑round test.

Image Generation Experiments

Using a Skill that wraps the Agnes image API, three prompt sets were evaluated:

Portrait : “一张真实摄影风格的成年女性半身人像…”。 The result preserved facial details and lighting without over‑smoothing.

City night‑scene : “横版 16:9 电影感城市夜景…”。 The generated image showed layered neon reflections and a wet ground, matching the described atmosphere.

Icon : “设计一个 AI 笔记应用图标,1:1…”。 The output was usable for a demo but required further refinement for production quality.

The Agnes‑Image‑2.1‑Flash model supports 4K generation, currently in a gray‑scale rollout.

Video Generation Experiments

Three video prompts were sent to the Agnes‑Video‑2.0 model:

Short monologue : Fixed‑camera shot of a man saying a single line. The video displayed stable framing and clear lip sync.

Multi‑character dialogue : A scene with a cat and a dog in a factory, including comedic exchanges. The result maintained consistent character actions and eye lines across cuts.

Product demo storyboard : A 15‑second sequence split into five stages (user input, agent reads files, writes code, runs tests, generates report). Detailed shot breakdowns improved control over timing and visual flow.

Video generation is slower than text; high‑traffic periods may add noticeable latency.

Packaging as Skills

Reusable Skill definitions were created to encapsulate model name, endpoint, parameter limits and error handling: agnes-code-review: Calls agnes-2.0-flash for code review tasks. agnes-cover: Generates cover‑image prompts and invokes agnes-image-2.1-flash. agnes-video-demo: Accepts a product description, splits it into shot specifications, validates num_frames against the allowed set {81,121,161,241,441}, creates a video task and returns task_id.

These Skills reduce repetitive configuration when invoking the API from agents.

Usage Data and Performance Insights

Official statistics for the first week of free access reported:

Agnes‑2.0‑Flash: >1 trillion tokens processed.

Agnes‑Image‑2.1‑Flash: >2 million images generated.

Agnes‑Video‑2.0: >2 million seconds of video generated.

The volume indicates substantial traffic and explains occasional response slowdowns during peak periods, especially for multi‑modal tasks that issue many sequential API calls.

References

Agnes API documentation: https://agnes-ai.com/doc/

Agnes API platform: https://platform.agnes-ai.com/

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AgentClaude CodeMultimodal APISkillCC SwitchFree TokensAgnes AI
JavaGuide
Written by

JavaGuide

Backend tech guide and AI engineering practice covering fundamentals, databases, distributed systems, high concurrency, system design, plus AI agents and large-model engineering.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.