Skip to main content

External calls

Public testnet programs run as WASM. Use gora.http_get to read an allowed HTTP endpoint and gora.llm_json to request schema-validated AI output. JavaScript in your frontend can fetch ordinary browser resources, but it does not execute as a Gora validator program or obtain the model provider’s key.

Read HTTP data

Declare the capability in gora.app.json:
The WASM import is:
Pass a UTF-8 URL pointer/length and an output buffer pointer/capacity. A nonnegative result is the response byte count; a negative result is an error. The runtime checks the host allowlist, destination addresses, request deadline, call count and response/output-buffer bounds. Redirects are not followed. Public apps cannot use this interface to reach private VM services. This is a GET interface, not a general fetch implementation: arbitrary request headers, POST bodies, sockets and streaming are not part of this ABI. Never put secrets in URL query strings, app configuration or published bundles. See the runtime reference for exact signatures.

Request structured AI

Use gora.llm_json(ptr, len, out_ptr, out_cap) with JSON containing instructions, prompt, an object-root schema and an optional max_completion_tokens. The managed host supplies its configured provider, model and server-side credential. An app cannot substitute its own endpoint or retrieve that credential through the call. The public testnet requires prepaid test GORA from the first provider attempt. The current price is one test GORA per dispatched attempt, including provider errors. Replaying an already captured result does not buy another call. See AI credits for billing, structured-output examples and original-payment recovery. Obtain informed permission before sharing user inputs/state with the model provider; payment or wallet connection is not AI-sharing consent.

What validators verify

The managed coordinator captures each external response once. Managed validators then execute fresh WASM stores against the same captured inputs and sign their observed output and state transition. The receipt commits to the request, program, transcript and result; it retains signed replay votes. This verifies consistent program execution given the captured response. It does not independently establish that an HTTP price is true, that the model is correct, or that every validator contacted the source. A compromised managed operator remains a trust risk: validator keys, execution and provider access are hosted on one VM during this phase. Independent-fetch/median consensus is not a published testnet host mode. An app needing several sources can explicitly read multiple allowed endpoints and validate timestamps, disagreement and missing values in its own program. This is still managed capture and replay, not independently hosted retrieval.

Freshness, scheduling and failure

An autonomous app uses a Gora instance schedule; its browser does not have to remain open. Each scheduled run can obtain external data and propose a chain callback. There are separate failure points: source retrieval, execution, quorum, settlement and on-chain confirmation. Inspect each stage rather than treating a successful invocation as a fresh on-chain value. Check source timestamps and acceptable age in your app, and enforce a maximum age in the consuming contract where appropriate. On error, keep the last known value visibly dated and pause unsafe actions; never invent a fresh timestamp. Retain original request IDs, captured attempts and signed transactions after uncertainty. Retry confirmation/reconciliation, not a new spending request. Rich frontend images and videos can remain on HTTPS CDNs. Browser media loads are separate from these metered WASM host calls and are not validator-attested.