Skip to content

feat: add injective-x402-payment skill#14

Open
Intellihackz wants to merge 4 commits into
InjectiveLabs:masterfrom
Intellihackz:master
Open

feat: add injective-x402-payment skill#14
Intellihackz wants to merge 4 commits into
InjectiveLabs:masterfrom
Intellihackz:master

Conversation

@Intellihackz

@Intellihackz Intellihackz commented Jun 9, 2026

Copy link
Copy Markdown

Overview

This PR introduces the `injective-x402-payment` skill, enabling AI agents (like Claude) to autonomously pay for

gated API endpoints and services using the x402 protocol on Injective EVM.

Changes Made

* Added `skills/injective-x402-payment/SKILL.md` guide.
* Detailed the workflow for using the `x402_fetch` MCP tool.
* Added instructions teaching the agent how to natively handle HTTP `402 Payment Required` responses using USDC,

without the need for API keys or prior registration.

Why

As AI agents scale and operate autonomously, traditional API key billing becomes a bottleneck. The x402 protocol

allows endpoints to quote a price, and agents to programmatically settle that cost per-request in ~650ms on
Injective EVM. This skill bridges that capability so agents know exactly how to trigger those payments via MCP.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for the injective-x402-payment skill, detailing implementation guidance for x402 payment functionality on Injective EVM. Includes complete workflow instructions with parameter specifications, practical usage examples, system prerequisites, and requirements for wallet setup and token holdings.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Intellihackz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 44 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5f029e77-ba23-4707-bac2-227be535fed6

📥 Commits

Reviewing files that changed from the base of the PR and between 89277cd and a1a7ba7.

📒 Files selected for processing (2)
  • README.md
  • skills/injective-x402-payment/SKILL.md
📝 Walkthrough

Walkthrough

This PR introduces documentation for the injective-x402-payment skill, defining how to use x402 (HTTP 402 Payment Required) on Injective with USDC payments. The SKILL.md file includes skill metadata, an overview of x402 mechanics, MCP-based workflow with the x402_fetch tool, example call scenarios, and required prerequisites.

Changes

Injective x402 Payment Skill

Layer / File(s) Summary
x402 payment skill documentation
skills/injective-x402-payment/SKILL.md
New SKILL.md file documents the injective-x402-payment skill with metadata (author, version, license), overview of x402 mechanics on Injective EVM, two-step workflow for the x402_fetch MCP tool with parameters, example usage scenario, and prerequisites (wallet, USDC, INJ for gas).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • maxim-inj
  • achilleas-kal
  • Kishan-Dhakan
  • ChuhanJin

Poem

🐰 A brand new skill hops into view,
x402 payments, on Injective too!
With USDC flowing through the air,
Doc's completed with utmost care. ✨
The rabbit approves—what a wonderful pair!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add injective-x402-payment skill' directly and concisely summarizes the main change—adding a new skill documentation file for x402 payments on Injective, which is the primary change in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/injective-x402-payment/SKILL.md`:
- Line 29: Update the SKILL.md entry for the password input to include explicit
secret-handling guidance: for the **password** keystore field (used by the
payment flow), state that it must never be logged, echoed, stored in
prompts/history, or persisted in any files or telemetry, and instruct
integrators to supply it only via secure secret input channels (e.g., secrets
manager or secret input widget) and to redact it from any debug output; also add
a short example note about using environment variables or secret stores rather
than inline literals.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 926883e1-9254-4944-95d3-b73067344d62

📥 Commits

Reviewing files that changed from the base of the PR and between d0093bb and 89277cd.

📒 Files selected for processing (1)
  • skills/injective-x402-payment/SKILL.md

Comment thread skills/injective-x402-payment/SKILL.md Outdated
Example:
When calling an endpoint like `https://agents.injective.com/x402/perps`, the server will return a 402 quote. The MCP tool will handle signing a USDC transfer on Injective EVM to the facilitator and return the final data payload.

## Prerequisites

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to state that the Injective MCP server needs to be running.
perhaps reference the existing skill for how to set that up: https://github.com/InjectiveLabs/agent-skills/blob/master/skills/injective-mcp-servers/SKILL.md

Comment thread skills/injective-x402-payment/SKILL.md Outdated
## Prerequisites
- EVM wallet connected to Injective network
- A small amount of USDC for payments
- INJ tokens for gas fees

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- INJ tokens for gas fees
- INJ to pay network transaction fees

note that INJ is not a token, but rather a cryptocurrency.

Comment thread skills/injective-x402-payment/SKILL.md Outdated
- **maxAmount**: (Optional) A safety limit on the maximum USDC amount you are willing to pay for this request.

Example:
When calling an endpoint like `https://agents.injective.com/x402/perps`, the server will return a 402 quote. The MCP tool will handle signing a USDC transfer on Injective EVM to the facilitator and return the final data payload.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When calling an endpoint like `https://agents.injective.com/x402/perps`, the server will return a 402 quote. The MCP tool will handle signing a USDC transfer on Injective EVM to the facilitator and return the final data payload.
When calling an endpoint like `https://agents.injective.com/x402/perps`, the server will return an x402 quote. The MCP tool will handle signing a USDC transfer on Injective EVM to the facilitator and return the final data payload.

- **address**: Your Injective wallet address.
- **password**: Your keystore password to authorize the payment.
- **url**: The URL of the x402-gated endpoint you wish to call.
- **maxAmount**: (Optional) A safety limit on the maximum USDC amount you are willing to pay for this request.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to: InjectiveLabs/mcp-server#12 (comment)

needs to be implemented not here, but rather in the MCP server tool

Copilot AI review requested due to automatic review settings June 24, 2026 05:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new injective-x402-payment skill document intended to guide agents in paying for x402-gated HTTP endpoints on Injective EVM using USDC.

Changes:

  • Added a new skill (injective-x402-payment) with a short overview and workflow for x402-based payments.
  • Documented intended usage of an x402_fetch MCP tool (including parameters and an example endpoint).
  • Listed basic prerequisites (wallet + USDC + INJ for gas).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +8
---
name: injective-x402-payment
description: Use x402 on Injective to pay for AI services and gated API endpoints directly from the terminal or MCP using USDC.
license: Apache-2.0
metadata:
author: zed
version: "1.0.0"
---
Comment on lines +21 to +23
The Injective MCP server provides a tool to fetch data from an x402-protected endpoint:

- `x402_fetch` - Automatically fetches an x402-gated URL, signs the payment using your Injective EVM wallet if a 402 Payment Required is returned, submits the payment receipt via the facilitator, and retries the request to deliver the gated data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants