Skip to content
smol.Docs

    Open console

    Make your first request

    Call a ready endpoint from a backend, inspect its Activity record, then revoke the test credential.

    You can use inference without an Application. This walkthrough uses a direct endpoint credential, one short prompt, and the integration example generated for your endpoint. A provider can charge for the request. An existing EC2 deployment can also incur charges while idle.

    1. Open Inference, select the endpoint and read Overview. If it needs setup, follow its indicated action first; see access and readiness.
    2. In Connect → Access credentials, choose Create credential. Give the test a recognizable name such as first-request; set an expiry if appropriate.
    3. Save the client ID and the one-time client secret in a server-side secret store. A credential inherits access to this endpoint’s attached Context Spaces, including spaces attached later. It is not an organization-wide API key.
    1. In Connect, find the request example. Confirm the endpoint URL and model. Set the prompt to Reply with exactly the word AURORA. Leave Use shared context off for the example; any automatic defaults already configured on the endpoint may still apply.

    2. Select Python and copy the generated example into first_request.py. It uses the Python standard library to exchange the credential for a short-lived bearer token and submit one non-streaming request. At the end of the file, add:

      print(completion["choices"][0]["message"]["content"])
    3. In the backend environment, make the saved values available as SMOL_CLIENT_ID and SMOL_CLIENT_SECRET. Choose a new SMOL_REQUEST_KEY for this one logical request, and retain it with the attempt record; the example sends it as Idempotency-Key. For example, generate a UUID with python3 -c 'import uuid; print(uuid.uuid4())' and save the result before sending. Never put a client secret or bearer token in browser code, source control or logs.

    4. Run python3 first_request.py once. The expected reply is AURORA. Generations can vary: a different response is an answer-quality outcome, not by itself a transport failure.

    Prefer cURL or JavaScript? Select the corresponding example on the same tab. The HTTP example needs an access token, not the one-time client secret. See authentication and the inference API.

    In Activity, refresh and inspect the recent request, or look it up by its Smol request ID if available. Match the time and outcome. An idempotency key identifies your submission; it is not the request ID used by the Activity search. A successful answer demonstrates execution, not a cache hit or a cost saving.

    In Connect → Access credentials, choose Revoke on the test credential and confirm. Revoking access does not stop EC2 compute; use deployment cleanup separately if needed.

    If the call times out, disconnects or has an unclear outcome, do not automatically submit again. Keep the original request key and inspect Activity before deciding what to do. See errors and idempotency.