Sections

Account: model keys

Used by the website. These routes don't accept an API key.

DELETE/account/model-credential

Delete Model Credential

Website sign-in only
curl
curl -X DELETE 'https://api.papervantage.com/account/model-credential' \
  -H "Authorization: Bearer $COGNITO_ACCESS_TOKEN"

GET/account/model-credential

Get Model Credential

Website sign-in only
Response: CredentialState
FieldTypeDescription
credential *CredentialView | null
daily_turn_limit *integer
key_last4 *string
label *string | null
last_error *string | null
last_used_at *string | null
model *string
model_label *string
monthly_limit_usd *number
provider *string
provider_name *string
region *string | null
resets_at *string | null
supported *boolean
turns_today *integer
used_usd *number
daily_turn_limit *integer
default_monthly_limit_usd *number
enabled *boolean
is_member *boolean
max_monthly_limit_usd *number
providers *object[]
curl
curl 'https://api.papervantage.com/account/model-credential' \
  -H "Authorization: Bearer $COGNITO_ACCESS_TOKEN"

PUT/account/model-credential

Put Model Credential

Website sign-in only
Request body (JSON)
FieldTypeDescription
api_key *string
labelstring | null
model *string
monthly_limit_usdnumber | null
provider *string
regionstring | null
Response: CredentialState
FieldTypeDescription
credential *CredentialView | null
daily_turn_limit *integer
key_last4 *string
label *string | null
last_error *string | null
last_used_at *string | null
model *string
model_label *string
monthly_limit_usd *number
provider *string
provider_name *string
region *string | null
resets_at *string | null
supported *boolean
turns_today *integer
used_usd *number
daily_turn_limit *integer
default_monthly_limit_usd *number
enabled *boolean
is_member *boolean
max_monthly_limit_usd *number
providers *object[]
curl
curl -X PUT 'https://api.papervantage.com/account/model-credential' \
  -H "Authorization: Bearer $COGNITO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provider":"<provider>","api_key":"<api_key>","model":"<model>"}'

POST/account/model-credential/openrouter/callback

Openrouter Callback

Website sign-in only
Request body (JSON)
FieldTypeDescription
code *string
code_verifier *string
model *string
monthly_limit_usdnumber | null
Response: CredentialState
FieldTypeDescription
credential *CredentialView | null
daily_turn_limit *integer
key_last4 *string
label *string | null
last_error *string | null
last_used_at *string | null
model *string
model_label *string
monthly_limit_usd *number
provider *string
provider_name *string
region *string | null
resets_at *string | null
supported *boolean
turns_today *integer
used_usd *number
daily_turn_limit *integer
default_monthly_limit_usd *number
enabled *boolean
is_member *boolean
max_monthly_limit_usd *number
providers *object[]
curl
curl -X POST 'https://api.papervantage.com/account/model-credential/openrouter/callback' \
  -H "Authorization: Bearer $COGNITO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code":"<code>","code_verifier":"<code_verifier>","model":"<model>"}'

GET/account/model-credential/openrouter/start

Start OpenRouter's PKCE flow. The browser keeps the verifier (sessionStorage) and goes to OpenRouter, which

Website sign-in only

sends it back to /account/openrouter-callback with a code; the frontend then POSTs code + verifier below.

Response: OpenRouterStart
FieldTypeDescription
code_verifier *string
state *string
url *string
curl
curl 'https://api.papervantage.com/account/model-credential/openrouter/start' \
  -H "Authorization: Bearer $COGNITO_ACCESS_TOKEN"

Next: In-paper assistant