Files
aitest/8-skill.md
2026-03-17 02:14:29 +00:00

33 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
```
$ curl -X POST 'https://api.openai.com/v1/skills' -H "Authorization: Bearer $OPENAI_API_KEY" -F 'files[]=@./contacts/SKILL.md;filename=contacts/SKILL.md;type=text/markdown''
{
"id": "skill_69b7aab7a0988191afca6ad2c530326b07c9ae27b6429c7c",
"object": "skill",
"created_at": 1773644471,
"default_version": "1",
"description": "My contact list",
"latest_version": "1",
"name": "contacts"
}
```
会被上传到 OpenAI可以在个人中心的 Storage 里的 Skills 标签下找到。
注意通过curl上传必须只有一级目录不能有子目录 skills/contacts/skill.md否则会报错
```
{
"error": {
"message": "Exactly one of SKILL.md or Skills.md must be present in the skill root",
"type": "invalid_request_error",
"param": "files",
"code": "invalid_value"
}
}
```
curl -X POST 'https://api.openai.com/v1/skills' \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-F 'files[]=@./contacts2/skill.md;filename=contacts2/skill.md;type=text/markdown' \
-F 'files[]=@./contacts2/contacts.csv;filename=contacts2/contacts.csv;type=text/csv'