Expand description
Official Rust SDK for the FloopFloop API.
§Quickstart
use floopfloop::{Client, CreateProjectInput};
let client = Client::new(std::env::var("FLOOP_API_KEY")?)?;
let created = client.projects().create(CreateProjectInput {
prompt: "A landing page for a cat cafe".into(),
subdomain: Some("cat-cafe".into()),
bot_type: Some("site".into()),
..Default::default()
}).await?;
let live = client.projects().wait_for_live(&created.project.id, None).await?;
println!("Live at: {}", live.url.unwrap_or_default());§Resources
projects— create / list / get / status / refine / cancel / reactivate / conversations / stream / wait_for_livesubdomains— check / suggestsecrets— list / set / removelibrary— list / cloneusage— summaryapi_keys— list / create / remove (remove accepts id OR name)uploads— create (S3 presign + direct PUT)user— me
Every resource method returns Result<T, FloopError> on failure.
FloopError.code is a FloopErrorCode enum with a catch-all Other
variant so unknown server codes still round-trip losslessly.
Structs§
- ApiKey
Summary - ApiKeys
- Client
- The main entry point. Construct once with
Client::neworClient::builderand reuse across tasks; all methods are&self. - Client
Builder - Configuration for
Client::builder. Defaults: - Clone
Library Project Input - Cloned
Project - Conversation
Message - Conversations
Options - Conversations
Result - Create
ApiKey Input - Create
Project Input - Create
Upload Input - Single file to upload. Explicit
file_typeoverrides the extension guess. The payload is held asBytes— streaming reqwestBodysupport can be layered on later if needed. - Created
Project - Deployment
- Floop
Error - The one error type every SDK call returns on failure. Pattern-match
on
.codeto branch: - Issued
ApiKey - Returned ONCE on Create — the
raw_keyis the only time the full secret ever leaves the server. Surface it to the user and do not persist it. - Library
- Library
List Options - Library
Project - List
Projects Options - Project
- Projects
- Refine
Attachment - Refine
Input - Refine
Result - Three-shape discriminated result from
Projects::refine. Exactly one ofqueued,saved_only, orprocessingisSome— pattern-match to branch. - Secret
Summary - Secrets
- Status
Event - Stream
Options - Configures
Projects::streamandProjects::wait_for_live. - Subdomain
Check Result - Subdomain
Suggest Result - Subdomains
- Uploaded
Attachment - Uploads
- Usage
- Usage
Summary - User
- UserApi
- Named
UserApirather thanUserbecause theUsertype already owns the slot. Accessed viaclient.user()— matches the Go SDK’sclient.Userconvention.
Enums§
- Floop
Error Code - Error codes returned by the FloopFloop API plus a few the SDK itself
produces for transport-level failures. Unknown server codes pass
through verbatim in
FloopError::codeso callers can handle new codes without an SDK update.
Constants§
- MAX_
UPLOAD_ BYTES - Per-file ceiling enforced by the backend. Matches the Node / Python / Go SDKs and the CLI.
- VERSION
- Library semver, kept in sync with the latest
v*git tag.
Type Aliases§
- Stream
Handler - Callback invoked on every de-duplicated status snapshot — including
the terminal event. Return
Ok(())to continue polling, or anyErrto stop early (the error propagates fromstream). - Wait
ForLive Options - Alias kept for parity with the Go SDK’s
WaitForLiveOptionsname.