| name | optimai-search |
| description | Use when an AI coding agent needs to integrate OptimAI Search using the OptimAI MCP server or OptimAI x402 SDK, configure MCP clients, build pay-per-call search agents, explain response formats, choose MCP versus x402, persist payment context, or troubleshoot public OptimAI Search developer workflows. |
OptimAI Search
Use this skill to help developers integrate OptimAI Search into AI agents, coding agents, chatbots, research tools, or pay-per-call workflows.
This skill is public-facing. It covers only:
@optimai-network/search-mcp
@optimai-network/x402-sdk
Do not include backend operations, production deployment steps, private database details, internal service debugging, or non-public credentials.
Choose The Integration
Use MCP when:
- The user has an OptimAI API key.
- The user wants Claude Code, Codex, Cursor, Copilot, or another MCP host to call OptimAI Search as tools.
- The task is agent workflow setup, MCP configuration, or tool usage guidance.
Use x402 SDK when:
- The user wants wallet-based, pay-per-call access without an OptimAI API key.
- The integration must handle
402 Payment Required, payment signing, and follow-up access.
- Another worker, process, or agent will poll for results later and needs persisted
paymentContext.
If both are viable, recommend MCP for fastest agent-client setup and x402 for public, accountless, pay-per-call products.
Core Rules
- Do not invent OptimAI request or response fields.
- Prefer
optimai_start_search then optimai_get_search for MCP because searches commonly take 60-90 seconds.
- Use
optimai_search only when a short blocking convenience call is acceptable.
- For x402, present EVM/Base and Solana as sibling payment options when wallet setup matters; do not imply Solana replaces EVM.
- For x402, persist
paymentContext with the search id when another worker or agent may poll later.
- Never ask users to paste private keys, API keys, or payment signatures into public prompts, logs, screenshots, or bug reports.
- Keep examples public and developer-facing. Do not reference private production flows.
References
Read only the files needed for the user's request:
references/mcp.md: MCP setup, tool names, and recommended polling flow.
references/x402-sdk.md: pay-per-call SDK usage, payment handler setup, and payment context persistence.
references/response-format.md: search statuses, progress, citations, result shape, and x402 payment statuses.
references/examples.md: copyable Codex, Claude/Cursor, Copilot, and x402 examples.
references/troubleshooting.md: common setup, runtime, and payment errors.
Response Style
Explain the integration choice in simple terms first, then give exact configuration or code. When the user asks for implementation help, produce copyable snippets and name the required environment variables.