curl --request POST \
--url http://localhost:3001/v1/training/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "<string>",
"provider": "auto",
"provider_preferences": [],
"funding_preference": "auto",
"credential_id": "<string>",
"max_cost_microusd": 2,
"idle_ttl_s": 43230,
"metadata": {}
}
'import requests
url = "http://localhost:3001/v1/training/sessions"
payload = {
"request_id": "<string>",
"provider": "auto",
"provider_preferences": [],
"funding_preference": "auto",
"credential_id": "<string>",
"max_cost_microusd": 2,
"idle_ttl_s": 43230,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
request_id: '<string>',
provider: 'auto',
provider_preferences: [],
funding_preference: 'auto',
credential_id: '<string>',
max_cost_microusd: 2,
idle_ttl_s: 43230,
metadata: {}
})
};
fetch('http://localhost:3001/v1/training/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "provisioning",
"provider": "modal",
"funding_source": "platform",
"lease_epoch": 1,
"lease_expires_at": "2023-11-07T05:31:56Z",
"max_cost_microusd": 123,
"error_code": "<string>",
"capability": {
"provider": "modal",
"models": [
"<string>"
],
"operations": [
"<string>"
],
"sampler_operations": [
"<string>"
],
"resource_profiles": {},
"billing_snapshot": {}
},
"capability_snapshot": {
"provider": "modal",
"models": [
"<string>"
],
"operations": [
"<string>"
],
"sampler_operations": [
"<string>"
],
"resource_profiles": {},
"billing_snapshot": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>",
"funding_source": "platform"
}Create and provision a provider-routed training session.
request_id is the session-creation idempotency key. provider: auto
uses preferences then Whitney’s provider order. The returned capability
snapshot is immutable for the session. Modal idle TTL is capped by the
runtime’s trainer lifetime even when a larger value is requested.
curl --request POST \
--url http://localhost:3001/v1/training/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "<string>",
"provider": "auto",
"provider_preferences": [],
"funding_preference": "auto",
"credential_id": "<string>",
"max_cost_microusd": 2,
"idle_ttl_s": 43230,
"metadata": {}
}
'import requests
url = "http://localhost:3001/v1/training/sessions"
payload = {
"request_id": "<string>",
"provider": "auto",
"provider_preferences": [],
"funding_preference": "auto",
"credential_id": "<string>",
"max_cost_microusd": 2,
"idle_ttl_s": 43230,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
request_id: '<string>',
provider: 'auto',
provider_preferences: [],
funding_preference: 'auto',
credential_id: '<string>',
max_cost_microusd: 2,
idle_ttl_s: 43230,
metadata: {}
})
};
fetch('http://localhost:3001/v1/training/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "provisioning",
"provider": "modal",
"funding_source": "platform",
"lease_epoch": 1,
"lease_expires_at": "2023-11-07T05:31:56Z",
"max_cost_microusd": 123,
"error_code": "<string>",
"capability": {
"provider": "modal",
"models": [
"<string>"
],
"operations": [
"<string>"
],
"sampler_operations": [
"<string>"
],
"resource_profiles": {},
"billing_snapshot": {}
},
"capability_snapshot": {
"provider": "modal",
"models": [
"<string>"
],
"operations": [
"<string>"
],
"sampler_operations": [
"<string>"
],
"resource_profiles": {},
"billing_snapshot": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>",
"funding_source": "platform"
}Authorizations
Whitney-issued API key. No organization-selection header is accepted.
Body
1 - 200auto, modal, tinker 2modal, tinker auto, platform, byok 1 - 200Optional immutable session ceiling in micro-USD. A request value replaces the organization default and is reserved exactly. If both are absent, a platform-funded session atomically reserves up to $100 of remaining organization headroom without crossing the shared -$100 credit floor. BYOK sessions may remain null while time and lease bounds still apply.
x >= 160 <= x <= 86400Show child attributes
Show child attributes
Response
The session was created or an idempotent equivalent was returned.
^wts_[0-9a-f]{32}$provisioning, ready, failed, closing, closed, interrupted, timed_out modal, tinker platform, byok x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
