Orishare
Api
GET
/ai/rule_drafts
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Query Parameters

limit?integer
Range1 <= value <= 100
Default20

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/ai/rule_drafts"
{  "data": [    {      "id": "string",      "status": "succeeded",      "request": "string",      "rules": [        {          "name": "string",          "definition": null,          "explanation": "string",          "warnings": [            {              "code": "string",              "path": "string",              "message": "string"            }          ]        }      ],      "assumptions": [        "string"      ],      "questions": [        "string"      ],      "errors": [        {          "rule": 0,          "code": "string",          "path": "string",          "message": "string"        }      ],      "model": "string",      "prompt_hash": "string",      "usage": {        "input_tokens": 0,        "output_tokens": 0      },      "context": {        "chars": 0,        "truncated": [          "string"        ]      },      "rule_id": "string",      "rule_version_id": "string",      "created_at": "string"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/ai/rule_drafts
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/ai/rule_drafts" \  -H "Content-Type: application/json" \  -d '{    "request": "When a customer buys an audiobook give them 100 points, 50 more when they get halfway through it, and 200 when they finish it. Each of those only once per title.",    "max_rules": 5  }'
{  "id": "string",  "status": "succeeded",  "request": "string",  "rules": [    {      "name": "string",      "definition": null,      "explanation": "string",      "warnings": [        {          "code": "string",          "path": "string",          "message": "string"        }      ]    }  ],  "assumptions": [    "string"  ],  "questions": [    "string"  ],  "errors": [    {      "rule": 0,      "code": "string",      "path": "string",      "message": "string"    }  ],  "model": "string",  "prompt_hash": "string",  "usage": {    "input_tokens": 0,    "output_tokens": 0  },  "context": {    "chars": 0,    "truncated": [      "string"    ]  },  "rule_id": "string",  "rule_version_id": "string",  "created_at": "string"}
GET
/ai/rule_drafts/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/ai/rule_drafts/string"
{  "id": "string",  "status": "succeeded",  "request": "string",  "rules": [    {      "name": "string",      "definition": null,      "explanation": "string",      "warnings": [        {          "code": "string",          "path": "string",          "message": "string"        }      ]    }  ],  "assumptions": [    "string"  ],  "questions": [    "string"  ],  "errors": [    {      "rule": 0,      "code": "string",      "path": "string",      "message": "string"    }  ],  "model": "string",  "prompt_hash": "string",  "usage": {    "input_tokens": 0,    "output_tokens": 0  },  "context": {    "chars": 0,    "truncated": [      "string"    ]  },  "rule_id": "string",  "rule_version_id": "string",  "created_at": "string"}