Skip to content

Add a method

POST
/v1/methods
curl --request POST \
--url https://api.pensievelabs.co/v1/methods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "slug": "curriculum", "markdown": "# Curriculum fine-tuning\n\nFine-tune on easy cases first, then hard ones.\n" }'

A post-training method of your own, as a markdown file. From then on the agents can choose it for an experiment, and you can name it when you suggest one. A slug is used only once: the slug of a removed method can’t be taken again.

Idempotency-Key
string
<= 255 characters

Any unique string. Sending it again within 24 hours returns the first response.

Media typeapplication/json
object
slug
required

A post-training method’s slug, such as fine-tuning. See List methods for what your workspace has.

string
<= 64 characters /^[a-z0-9]+(-[a-z0-9]+)*$/
markdown
required

The method, in plain markdown. It must start with a # title, then a paragraph.

string
>= 1 characters <= 100000 characters

Example

{
"slug": "curriculum",
"markdown": "# Curriculum fine-tuning\n\nFine-tune on easy cases first, then hard ones.\n"
}

The method.

Media typeapplication/json

A post-training method, written as a plain markdown file. It starts with a # title and a paragraph saying what the method does and when to try it; the rest is up to its author. Pensieve’s own files have Needs, Steps, Settings (what an experiment can change) and Checks. Agents read the file to design experiments with the method and follow it as written.

object
id
required

A post-training method’s slug, such as fine-tuning. See List methods for what your workspace has.

string
<= 64 characters /^[a-z0-9]+(-[a-z0-9]+)*$/
object
required
Allowed value: method
name
required

The file’s title.

string
description
required

The file’s first paragraph.

string
markdown
required

The whole file.

string
version
required

Goes up by one with every change. Each experiment records the version it ran.

integer
>= 1
built_in
required

Shipped by Pensieve. Built-in methods can’t be changed or removed.

boolean
created_at
required
string format: date-time
updated_at
required
string format: date-time

Example

{
"id": "fine-tuning",
"object": "method",
"name": "Fine-tuning"
}

Something went wrong; error.type says what.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: invalid_request authentication permission not_found conflict rate_limit not_available server
message
required
string
param

The request field the error is about.

string | null
request_id
required
string

Example

{
"error": {
"type": "invalid_request"
}
}