mirror of
https://github.com/hanzoai/flow.git
synced 2026-10-17 01:29:18 +00:00
21 lines
516 B
Python
21 lines
516 B
Python
import os
|
|
|
|
import requests
|
|
|
|
url = f"{os.getenv('FLOW_SERVER_URL', '')}/v1/responses"
|
|
|
|
headers = {
|
|
"x-api-key": f"{os.getenv('FLOW_API_KEY', '')}",
|
|
"Content-Type": "application/json",
|
|
"X-FLOW-GLOBAL-VAR-OPENAI_API_KEY": "sk-...",
|
|
"X-FLOW-GLOBAL-VAR-USER_ID": "user123",
|
|
"X-FLOW-GLOBAL-VAR-ENVIRONMENT": "production",
|
|
}
|
|
|
|
payload = {"model": "your-flow-id", "input": "Hello"}
|
|
|
|
response = requests.request("POST", url, headers=headers, json=payload)
|
|
response.raise_for_status()
|
|
|
|
print(response.text)
|