Core: Call API
metrecept_call_apiMake a read-only GET request to a registered third-party API and return the vendor response with a signed receipt hashing only path and query. Use it for authenticated vendor JSON APIs mid-session.
Instructions
Make a read-only GET call to a registered third-party API through the gateway and return the vendor's response body, with a signed receipt that stores only a hash of path and query. Use it for authenticated vendor JSON APIs mid-session. Register the service first with metrecept_register_api_service. Not for public web pages: use metrecept_fetch_web_pages. path must sit under the service's allowed_path_prefix (e.g. prefix "/v1" allows "/v1/lookup"); query is sent as the URL query string. Pass the same session_id as your chat and fetch calls to group them into one metrecept_get_session_receipt receipt. Billed per call at the plan rate. Unknown service returns 404 service_not_found; vendor errors and prefix violations return JSON {"error", "status"}. Requires a Metrecept API key (METRECEPT_API_KEY env on stdio, or Authorization: Bearer on remote HTTP); results are scoped to that key's tenant only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path under the service's allowed_path_prefix, e.g. "/v1/lookup". | |
| query | No | Optional query-string parameters as a flat object. | |
| purpose | No | Compliance purpose label (default business_api_audit). | business_api_audit |
| service | Yes | Registered service name (see metrecept_list_api_services). | |
| session_id | No | Optional session tag grouping this call into a metrecept_get_session_receipt receipt. | |
| service_key | No | Vendor credential forwarded to the third party and never stored; falls back to METRECEPT_SERVICE_KEY env. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |