Client
surfra.App and surfra.Workflow build a client for you. Construct surfra.SurfraClient when you want to pass the key or the URL in code.
import surfra
client = surfra.SurfraClient( api_key="sfk_...", base_url="https://api.surfra.io",)app = surfra.App("myllm-staging", client=client)If you omit the arguments, the client reads SURFRA_API_KEY and SURFRA_MASTER.
Methods
Section titled “Methods”| Method | Request |
|---|---|
deploy_app(name, *, image, entrypoint, env, registry, autoscale) |
PUT /v1/apps/{name} |
deploy_workflow(name, stages) |
PUT /v1/workflows/{name} |
submit(stages, *, metadata, callback_url) |
POST /v1/transactions |
transaction(transaction_id) |
GET /v1/transactions/{id} |
App.deploy calls deploy_app. App.submit calls submit. Workflow.deploy calls deploy_workflow.
The client sends Authorization: Bearer with the API key. A missing SURFRA_API_KEY raises KeyError when the client is constructed.
