Connect jpcite REST/OpenAPI to OpenAI Codex CLI / Agents SDK
Use jpcite from Codex / Agents SDK by wrapping the REST/OpenAPI surface as a function tool. Public MCP is stdio via uvx autonomath-mcp, not hosted HTTP. Anonymous free 3 req/IP/day; paid metered at ¥3/billable unit excl. tax.
Five-minute setup
- Review the OpenAPI spec: use
https://jpcite.com/openapi.agent.gpt30.jsonor the API reference. - Create a REST helper: call
https://api.jpcite.com/v1/programs/searchwithparamsand optionalX-API-Key. - Bind it to an Agent: register that helper through your agent framework's function-tool mechanism.
- (Optional) Pass an API key: set
JPCITE_API_KEYto upgrade to metered mode. Leave it unset for the anonymous free tier. - For MCP: use
uvx autonomath-mcpover stdio instead of a hosted HTTP endpoint.
Copy-paste snippet
A minimal REST helper that you can register as a function tool in your agent framework.
import os
import requests
def search_programs(q: str, prefecture: str = "東京都") -> dict:
headers = {}
if os.environ.get("JPCITE_API_KEY"):
headers["X-API-Key"] = os.environ["JPCITE_API_KEY"]
response = requests.get(
"https://api.jpcite.com/v1/programs/search",
params={"q": q, "prefecture": prefecture},
headers=headers,
timeout=20,
)
response.raise_for_status()
return response.json()
# Register this helper through your Agents SDK / agent framework function-tool mechanism.
print(search_programs("ものづくり補助金", "東京都"))
Verification
Search ものづくり補助金 東京都 through REST and confirm that the JSON response includes source URLs. MCP tools are available through the stdio package; generation of 36-Agreement labor documents is not offered publicly.
When smoke-testing the REST endpoint directly, always use -G --data-urlencode. Embedding a Japanese query straight into the URL breaks the HTTP request line, and the API returns {"error":{"code":"bad_request",...,"hint":"Use --data-urlencode for non-ASCII query params..."}}.
curl -G "https://api.jpcite.com/v1/programs/search" \
--data-urlencode "q=ものづくり補助金" \
--data-urlencode "prefecture=東京都" \
-H "X-API-Key: ${JPCITE_API_KEY:-}"
FAQ
REST direct vs MCP — which is better?
Use REST/OpenAPI for HTTP-only agents. Use uvx autonomath-mcp over stdio when your client supports MCP.
How do I issue an API key?
Issue one from /en/pricing.html#api-paid via Stripe Checkout (consent is in custom_text.submit.message). The anonymous free tier is capped at 3 req/day per IP; paid is metered at ¥3/billable unit excl. tax with no cap.
What is the 8-profession legal fence?
jpcite does not return individualized advice that would intrude on the exclusive practice areas under the Certified Tax Accountant Act §52, the Attorney Act §72, and similar statutes. See /en/legal-fence.html, and state it in your Agent's instructions as well.