Prompt tuning
Create prompt-tuning job
deprecated
Start tuning one decision’s wording for a base model, kettei-core unless model names
another (GET /v1/models lists them). A family, or a model by its number such as router@3,
is refused with 422 base_model_only. The job page shows its progress.
POST
/
v1
/
prompt-tuning
/
jobs
Create prompt-tuning job
curl --request POST \
--url https://api.sqwish.ai/v1/prompt-tuning/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "<string>",
"decision": "<string>",
"model": "<string>",
"effort": "standard",
"max_price_usd": "<string>"
}
'import requests
url = "https://api.sqwish.ai/v1/prompt-tuning/jobs"
payload = {
"dataset_id": "<string>",
"decision": "<string>",
"model": "<string>",
"effort": "standard",
"max_price_usd": "<string>"
}
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({
dataset_id: '<string>',
decision: '<string>',
model: '<string>',
effort: 'standard',
max_price_usd: '<string>'
})
};
fetch('https://api.sqwish.ai/v1/prompt-tuning/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "prompt_tuning.job",
"status": "queued",
"dataset_id": "<string>",
"model": "<string>",
"decision": "<string>",
"effort": "standard",
"price_usd": "<string>",
"charge": "free",
"test_looks": 123,
"progress": {
"phase": "<string>",
"round": 123,
"rounds": 123,
"original_loss": 123,
"best_loss": 123
},
"result": {
"verdict": "improved",
"tuned": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
},
"candidate": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
},
"changes": [
{
"part": "<string>",
"before": "<string>",
"after": "<string>"
}
],
"label_issues": [
{
"row": "<string>",
"reason": "<string>"
}
],
"original": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
},
"decision": "<string>",
"rows": 123,
"rows_left_out": 123,
"noise_band": 123,
"rounds": [
{
"round": 123,
"best_loss": 123
}
],
"reasons": [
"<string>"
],
"test": {}
},
"created_at": 123,
"updated_at": 123,
"error": "<string>",
"label_issues_dismissed_at": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}Body
application/json
The most you agree to pay for this job, in USD, such as the price you were shown. It is a decimal string, such as "2.500000000", never a JSON number, so no precision is lost: a number is refused with invalid_request, naming this field. If it costs more when it is admitted, it is refused with price_changed and nothing is held.
Pattern:
^\d{1,9}(\.\d{1,9})?$Response
Successful Response
Create prompt-tuning job
curl --request POST \
--url https://api.sqwish.ai/v1/prompt-tuning/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "<string>",
"decision": "<string>",
"model": "<string>",
"effort": "standard",
"max_price_usd": "<string>"
}
'import requests
url = "https://api.sqwish.ai/v1/prompt-tuning/jobs"
payload = {
"dataset_id": "<string>",
"decision": "<string>",
"model": "<string>",
"effort": "standard",
"max_price_usd": "<string>"
}
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({
dataset_id: '<string>',
decision: '<string>',
model: '<string>',
effort: 'standard',
max_price_usd: '<string>'
})
};
fetch('https://api.sqwish.ai/v1/prompt-tuning/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "prompt_tuning.job",
"status": "queued",
"dataset_id": "<string>",
"model": "<string>",
"decision": "<string>",
"effort": "standard",
"price_usd": "<string>",
"charge": "free",
"test_looks": 123,
"progress": {
"phase": "<string>",
"round": 123,
"rounds": 123,
"original_loss": 123,
"best_loss": 123
},
"result": {
"verdict": "improved",
"tuned": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
},
"candidate": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
},
"changes": [
{
"part": "<string>",
"before": "<string>",
"after": "<string>"
}
],
"label_issues": [
{
"row": "<string>",
"reason": "<string>"
}
],
"original": {
"id": "<string>",
"question": "<string>",
"kind": "single",
"outcomes": "<unknown>",
"rubric": [
"<unknown>"
],
"policy": {
"action_costs": {},
"abstain_below": 0.5
}
},
"decision": "<string>",
"rows": 123,
"rows_left_out": 123,
"noise_band": 123,
"rounds": [
{
"round": 123,
"best_loss": 123
}
],
"reasons": [
"<string>"
],
"test": {}
},
"created_at": 123,
"updated_at": 123,
"error": "<string>",
"label_issues_dismissed_at": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}