Skip to main content

Official Refactual REST API client for Python.

Project description

refactual-sdk

Official Refactual REST API client for Python.

Preview release (0.x) — APIs may shift before 1.0.0. Pin exact versions in production and follow the changelog for breaking notes.

pip install refactual-sdk

Quickstart

from refactual import Refactual

client = Refactual(api_key="rk_live_...")
reply  = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Explain async/await"}],
)
print(reply["content"])

OAuth 2.0 (client_credentials)

token = Refactual(api_key="rk_placeholder").oauth.token(
    client_id="rc_live_xxx",
    client_secret="rcs_live_xxx",
    scope=["chat:write", "chat:read"],
)
client = Refactual(access_token=token["access_token"])

Webhook verification

from refactual import verify_webhook
verify_webhook(raw_body, request.headers.get("Refactual-Signature"), secret)

See API.md for the full reference.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refactual_sdk-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refactual_sdk-0.1.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file refactual_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: refactual_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for refactual_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a0bea9d56494df722772298442fdf91e025ecc98a53ae77e429b7765a9e4c1f0
MD5 92ec296110a91350230e2ef6db645f4a
BLAKE2b-256 51741938142c0b52e28a967fbb03d9de5882e73a3a6c18a3aa01bcea525937d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for refactual_sdk-0.1.1.tar.gz:

Publisher: release-sdk-py.yml on refactual/refactual

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file refactual_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: refactual_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for refactual_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74e6715a6a71f01123eecbeedbfe368fa53ae3005cf50f0af73f470d2adf9fb5
MD5 35a8105d76f12ef1d19cba85e92589a7
BLAKE2b-256 e0e44c6f73c4bc988b009182c1af68447fa0d2fdbfec20bf4aad5ac2eaf3dd5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for refactual_sdk-0.1.1-py3-none-any.whl:

Publisher: release-sdk-py.yml on refactual/refactual

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page