Create a algorithm
POST
/v1/algorithmscurl -X POST 'https://api.embodiflow.io/v1/algorithms' \
-H 'Authorization: Bearer $EMBODIFLOW_PAT' \
-H 'Content-Type: application/json' \
-d '{
"source": "string",
"requirements": [
"string"
],
"version": "string",
"image": {
"ref": "string",
"entrypoint": [
"string"
]
}
}'认证
每个请求都需要携带个人访问令牌(PAT)。
- Authorization: Bearer PAT
请求头参数
- Idempotency-Keystring
Optional idempotency key, at most 255 characters (UUIDv4 recommended). A repeated key returns the first response byte-for-byte, including a 5xx. The same key with a different body, or a second in-flight request, returns 409 IDEMPOTENCY_CONFLICT. Keys are unique per tenant and retained for 24 hours.
请求体
Content-Typeapplication/json
- sourcestring
- requirementsarray<string>
- versionstring
- imageobject
- refstring必填
- entrypointarray<string>
响应
The saved version, with its frozen `manifest` and (Python) `sourceCode`. A save whose interface and code equal the latest usable version writes nothing and also answers 201, with the stored version and `meta.unchanged: true`.
- dataobject必填
- packageobject必填
- manifestobject必填
- sourcestring必填可选值pythonimage
- sourceCodestring | null必填
- requirementsarray<string>必填
- idstring必填
- algorithmIdstring必填
- versionstring必填
- revisionnumber必填
- imageRefstring必填
- imageDigeststring | null必填
- interfaceHashstring必填
- bumpWarningobject | null必填
- imageCommandarray<string>必填
- deprecatedAtstring | null必填
- disabledAtstring | null必填
- createdAtstring必填
- buildobject
- metaobject
- unchangedboolean必填可选值true
响应示例
{
"data": {
"package": {},
"manifest": {},
"source": "python",
"sourceCode": "string",
"requirements": [
"string"
],
"id": "string",
"algorithmId": "string",
"version": "string",
"revision": 0,
"imageRef": "string",
"imageDigest": "string",
"interfaceHash": "string",
"bumpWarning": {},
"imageCommand": [
"string"
],
"deprecatedAt": "string",
"disabledAt": "string",
"createdAt": "string",
"build": {
"buildId": "string",
"state": "queued",
"reason": "pip_resolution",
"startedAt": "string",
"finishedAt": "string"
}
},
"meta": {
"unchanged": true
}
}服务器https://api.embodiflow.io/v1https://api.embodiflow.dev/v1