fetch-hive/sdk Composer package when you want to start a Hive Agent run from PHP. The SDK wraps the public POST /v1/hive-agent/invoke endpoint with an idiomatic facade and handles authentication.
Hive Agent invocation does not stream and does not wait for the final answer in the HTTP response. The SDK returns identifiers immediately, then Fetch Hive sends a signed callback when the run completes, fails, or is cancelled.
Installation
Authentication
Set theFETCH_HIVE_API_KEY environment variable to your workspace API key (the client reads it automatically):
Basic example
Start a Hive Agent run and read the accepted response:invokeHiveAgent returns the parsed JSON body as an associative array as soon as the run is queued. See the accepted response shape.
Method reference
The SDK always sends
async.enabled: true with your callback_url. Hive Agent invocation is async-only.
Handling the response
Fetch Hive returns202 Accepted when the run is queued. Store webhook_secret so your callback receiver can verify X-Fetch-Hive-Signature.
Configuration
Errors
Missingcallback_url throws InvalidArgumentException before a request is sent. Non-2xx responses throw FetchHive\Sdk\Exception\ApiException carrying the status code and response body:
Links
Next steps
- Invoke from Code - Overview of starting runs from your app
- Run with Python SDK
- Run with Node.js SDK
- Run with Ruby SDK
- Invoke - Full endpoint reference

