用视频智能 构建应用。
已公开的 Seeknetic API 支持文本嵌入、异步视频嵌入、张量上传与专业镜头标注。
身份验证
在 X-API-Key 请求头中提供 API Key。可在 Seeknetic 账户中创建或管理密钥。
已发布 API 也支持 Authorization: Bearer <API_KEY>,可替代 X-API-Key;每个请求选择一种鉴权方式。
基础 URL: https://api.seeknetic.com
代码、API 标识符和请求值保留原有技术语言。
文本嵌入
将文本查询编码为嵌入向量,与已索引媒体进行语义比较。
POST
/video_embedding/encode_text cURL
curl -X POST "https://api.seeknetic.com/video_embedding/encode_text" \
-H "X-API-Key: {your_api_key}" \
-H "Content-Type: application/json" \
-d '{"text":"A dog playing in the park"}' Python / 示例
Python
import requests
response = requests.post(
"https://api.seeknetic.com/video_embedding/encode_text",
headers={
"X-API-Key": "{your_api_key}",
"Content-Type": "application/json"
},
json={"text": "A dog playing in the park"}
)
result = response.json()
print(f"Text embedding dimension: {len(result['embedding'])}") 视频嵌入
提交托管视频进行异步编码。保存返回的 request_id,再轮询结果。
使用预处理输入时,请引用张量上传接口返回的 tensor.video_input_key 和 tensor.audio_input_key。
POST
/video_embedding/encode_video/async cURL
curl -X POST "https://api.seeknetic.com/video_embedding/encode_video/async" \
-H "X-API-Key: {your_api_key}" \
-H "Content-Type: application/json" \
-d '{"video_url":"https://example.com/video.mp4"}' Python / 示例
Python
import requests
import time
# 1. Submit async task
response = requests.post(
"https://api.seeknetic.com/video_embedding/encode_video/async",
headers={
"X-API-Key": "{your_api_key}",
"Content-Type": "application/json"
},
json={"video_url": "https://example.com/video.mp4"}
)
request_id = response.json()["request_id"]
print(f"Task submitted, Request ID: {request_id}")
# 2. Poll status until completion
while True:
status_response = requests.get(
f"https://api.seeknetic.com/async_status/{request_id}",
headers={"X-API-Key": "{your_api_key}"}
)
status_data = status_response.json()
status = status_data['status']
if status == 'completed':
embedding = status_data['embedding']
print(f"Complete! Dimension: {len(embedding)}")
break
elif status == 'failed':
print(f"Failed: {status_data['error_message']}")
break
time.sleep(2) 张量上传
上传预处理的视频与音频张量,然后在异步模型请求中引用返回的输入键。
POST
/files/upload/tensors cURL
curl -X POST "https://api.seeknetic.com/files/upload/tensors" \
-H "X-API-Key: {your_api_key}" \
-H "Content-Type: application/json" \
-d '{
"service":"embedding",
"request_id":"emb-task-0001",
"video_input":{"data":"AAAB...","shape":[1,12,3,224,224],"dtype":"uint8"},
"audio_input":{"data":"AAAB...","shape":[1,1,220500],"dtype":"float32"}
}' Python / 示例
Python
import requests
response = requests.post(
"https://api.seeknetic.com/files/upload/tensors",
headers={
"X-API-Key": "{your_api_key}",
"Content-Type": "application/json"
},
json={
"service": "embedding",
"request_id": "emb-task-0001",
"video_input": {
"data": "AAAB...",
"shape": [1, 12, 3, 224, 224],
"dtype": "uint8"
},
"audio_input": {
"data": "AAAB...",
"shape": [1, 1, 220500],
"dtype": "float32"
}
}
)
print(response.json()) 镜头标注
提交视频,异步生成专业镜头元数据。
使用预处理标注输入时,请引用张量上传接口返回的 tensor.video_input_key 和 tensor.video_kwargs_key。
POST
/video_tagging/async cURL
curl -X POST "https://api.seeknetic.com/video_tagging/async" \
-H "X-API-Key: {your_api_key}" \
-H "Content-Type: application/json" \
-d '{"video_url":"https://example.com/video.mp4"}' Python / 示例
Python
import requests
# Submit async tagging task
response = requests.post(
"https://api.seeknetic.com/video_tagging/async",
headers={
"X-API-Key": "{your_api_key}",
"Content-Type": "application/json"
},
json={"video_url": "https://example.com/video.mp4"}
)
request_id = response.json()["request_id"]
print(f"Tagging task submitted, Request ID: {request_id}") 异步任务状态
查询已提交的请求。等待或处理中时继续轮询,完成后查看结果。
任务状态:pending → processing → completed。失败任务会返回 error_message。
GET
/async_status/{request_id} cURL
curl -X GET "https://api.seeknetic.com/async_status/{request_id}" \
-H "X-API-Key: {your_api_key}" Python / 示例
Python
import requests
request_id = "your_request_id_from_async_call"
response = requests.get(
f"https://api.seeknetic.com/async_status/{request_id}",
headers={"X-API-Key": "{your_api_key}"}
)
status_data = response.json()
print(f"Status: {status_data['status']}")
if status_data['status'] == 'completed':
print(f"Result: {status_data['embedding']}") 错误与重试
400 响应请检查输入参数,401 请检查密钥。429 后降低请求频率。临时服务端错误可采用有次数限制的重试策略。
| HTTP 状态码 | 说明 | 处理方式 |
|---|---|---|
| 400 | 请求参数错误 | 检查 JSON 格式和必需字段。 |
| 401 | 鉴权失败 | 检查 API Key,避免将密钥暴露在前端代码中。 |
| 402 | 额度不足 | 检查用量与账单,在额度恢复后重试。 |
| 413 | 请求内容过大 | 缩小请求内容,或分批上传更小的 tensors。 |
| 422 | 参数校验失败 | 检查字段类型和对应接口的请求结构。 |
| 429 | 超过速率限制 | 降低请求频率,延迟后重试。 |
| 500 | 服务内部错误 | 设置重试次数上限;持续失败时联系支持。 |
| 502 | 上游服务错误 | 等待后重试,并设置次数上限。 |
| 504 | 请求超时 | 使用异步工作流或更小的输入;重新提交前先查询任务状态。 |
速率限制
每个 API Key 有独立的 QPS(每秒请求数)限制,在创建密钥时设置;超过限制返回 HTTP 429。