Skip to content

World mode members

PUT
/open/v1/role/{roleId}/world
curl --request PUT \
--url https://api.harperharbor.com/open/v1/role/example/world \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "version": 1, "maxSpeakers": 1, "strictness": "lenient", "characters": [ { "id": "example", "name": "example", "avatar": "example", "sex": "example", "profile": "example", "description": "example", "lorebookId": "example" } ] }'

A world card is one agent configuration whose instructions describe a shared world and whose members each carry their own long description and, optionally, a private Lorebook the author owns. Every turn the service runs one world pass (a hidden judgment plus the visible narration) and then at most maxSpeakers member replies, all inside one operation and one charge. Authentication, role.write scope and authorship are required; a member’s lorebookId must be a Lorebook the author owns. Changing members changes the card’s content hash.

roleId
required
string

Role id.

Media typeapplication/json
object
version
required
integer
Allowed values: 1
maxSpeakers

Members that may reply in one turn; default 2.

integer
>= 1 <= 3
strictness

How far the world honours outcomes the player declares.

string
Allowed values: lenient balanced strict
characters
required
Array<object>
>= 1 items <= 12 items
object
id
required

Stable member id; used by mention and by the speaker blocks.

string
/^[a-z0-9][a-z0-9_-]{0,31}$/
name
required
string
<= 60 characters
avatar

Https URL, optional.

string
sex
string
profile

Short public side note everyone in the world knows; shown to viewers.

string
<= 600 characters
description

Private full definition; only this member’s own turns see it. Author only in responses.

string
<= 60000 characters
lorebookId

A Lorebook the author owns, recalled only for this member. Author only in responses.

string

The stored members, as the author sees them.

Media typeapplication/json
object
world
object
version
required
integer
Allowed values: 1
maxSpeakers

Members that may reply in one turn; default 2.

integer
>= 1 <= 3
strictness

How far the world honours outcomes the player declares.

string
Allowed values: lenient balanced strict
characters
required
Array<object>
>= 1 items <= 12 items
object
id
required

Stable member id; used by mention and by the speaker blocks.

string
/^[a-z0-9][a-z0-9_-]{0,31}$/
name
required
string
<= 60 characters
avatar

Https URL, optional.

string
sex
string
profile

Short public side note everyone in the world knows; shown to viewers.

string
<= 600 characters
description

Private full definition; only this member’s own turns see it. Author only in responses.

string
<= 60000 characters
lorebookId

A Lorebook the author owns, recalled only for this member. Author only in responses.

string
Example
{
"world": {
"version": 1,
"strictness": "lenient"
}
}

invalid JSON body, or invalid_arguments when a member id, limit or lorebook is not acceptable (including a Lorebook the author does not own).

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}

unauthorized.

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}

permission_denied.

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}

role_not_found.

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}