{"openapi":"3.1.0","info":{"title":"Sexy Models","version":"0.1.0"},"servers":[{"url":"https://api.sexymodels.fun"}],"paths":{"/v1/models":{"get":{"summary":"List Models","operationId":"list_models_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}}}}},"/v1/chat/completions":{"post":{"summary":"Create a chat completion","description":"Use a permanent sm_ API key as Authorization: Bearer <key>. Set stream: true for SSE streaming. Temporary trial and account-session chat keys are also accepted.","operationId":"post_chat_completions_v1_chat_completions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"text/event-stream":{}}},"402":{"description":"Insufficient credit balance"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"SMApiKey":[]}]}},"/v1/responses":{"post":{"summary":"Create a response","description":"Use a permanent sm_ API key as Authorization: Bearer <key>. Set stream: true for SSE streaming. Supports previous_response_id for conversation continuation.","operationId":"post_responses_v1_responses_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"text/event-stream":{}}},"402":{"description":"Insufficient credit balance"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"SMApiKey":[]}]}},"/v1/temp_api_keys":{"post":{"summary":"Create a temporary chat API key","description":"Send {\"kind\":\"trial\"} without credentials for free chat requests, or {\"kind\":\"account_session\"} using an account session to bill your balance. Temporary keys expire after one hour and authorize only chat completions.","operationId":"create_temp_key_v1_temp_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TempKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedTempKey"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"AccountSession":[]},{}]}},"/v1/signups/email":{"post":{"summary":"Start email signup or sign-in","operationId":"email_start_v1_signups_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStart"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStarted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/signups/email/complete":{"post":{"summary":"Verify email and create an account session","description":"Always requires the fresh emailed code, including returning users. Creates an account only after verification. Does not create an API key.","operationId":"email_complete_v1_signups_email_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailComplete"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/signups/wallet":{"post":{"summary":"Start wallet signup or sign-in","description":"Returns a fresh Solana signing challenge. New wallets receive a prepaid USDC invoice. Registered wallets do not pay again.","operationId":"wallet_start_v1_signups_wallet_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletStart"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletChallenge"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/signups/wallet/complete":{"post":{"summary":"Verify wallet and create an account session","description":"Verifies the signed challenge and, for new accounts, finalized USDC payment. Returns an account session, not an API key. Pending payments return 202 and Retry-After.","operationId":"wallet_complete_v1_signups_wallet_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletSessionComplete"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"202":{"description":"Payment pending finality; retry without another transfer"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/session":{"get":{"summary":"Get the signed-in account and session","operationId":"current_session_v1_session_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentSessionResponse"}}}}},"security":[{"AccountSession":[]}]},"delete":{"summary":"Revoke the current session and sign out","operationId":"delete_session_v1_session_delete","responses":{"204":{"description":"Successful Response"}},"security":[{"AccountSession":[]}]}},"/v1/api_keys":{"get":{"summary":"List API key metadata, without secrets","operationId":"list_keys_v1_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyListResponse"}}}}},"security":[{"AccountSession":[]}]},"post":{"summary":"Create a named API key","operationId":"create_key_v1_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRequest","default":{"name":"API key"}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"AccountSession":[]}]}},"/v1/api_keys/{key_id}":{"delete":{"summary":"Revoke an account-owned API key","operationId":"delete_key_v1_api_keys__key_id__delete","security":[{"AccountSession":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/user_accounts/me":{"get":{"summary":"Get my credit balance","description":"Accepts an account session or permanent API key, including at zero balance.","operationId":"account_balance_v1_user_accounts_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Account Balance V1 User Accounts Me Get"}}}}},"security":[{"AccountSession":[]},{"SMApiKey":[]}]}},"/v1/crypto/config":{"get":{"summary":"List USDC payment networks","operationId":"crypto_config_v1_crypto_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoConfigResponse"}}}}}}},"/v1/crypto/topups":{"post":{"summary":"Start Invoice","operationId":"start_invoice_v1_crypto_topups_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"AccountSession":[]},{"SMApiKey":[]}]}},"/v1/crypto/topups/{invoice_id}":{"get":{"summary":"Get payment invoice status","operationId":"invoice_status_v1_crypto_topups__invoice_id__get","security":[{"AccountSession":[]},{"SMApiKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/crypto/topups/{invoice_id}/verify":{"post":{"summary":"Verify a USDC payment and add credit","operationId":"verify_invoice_v1_crypto_topups__invoice_id__verify_post","security":[{"AccountSession":[]},{"SMApiKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AuthResponse":{"properties":{"status":{"type":"string","enum":["SUCCESS","PENDING"],"title":"Status","default":"SUCCESS"},"user_account":{"anyOf":[{"$ref":"#/components/schemas/UserAccountResponse"},{"type":"null"}]},"created":{"type":"boolean","title":"Created","default":false},"session":{"anyOf":[{"$ref":"#/components/schemas/SessionResponse"},{"type":"null"}]},"retry_after_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retry After S"}},"type":"object","title":"AuthResponse"},"ChatMessage":{"properties":{"role":{"type":"string","enum":["system","developer","user","assistant"],"title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"ChatRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","minItems":1,"title":"Messages"},"stream":{"type":"boolean","title":"Stream","default":false},"stream_options":{"anyOf":[{"$ref":"#/components/schemas/ChatStreamOptions"},{"type":"null"}]},"max_tokens":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Tokens"},"reasoning_effort":{"type":"string","enum":["none","low"],"title":"Reasoning Effort","description":"Set low to enable thinking. Token limits and usage include reasoning.","default":"none"}},"type":"object","required":["model","messages"],"title":"ChatRequest"},"ChatStreamOptions":{"properties":{"include_usage":{"type":"boolean","title":"Include Usage","default":false}},"type":"object","title":"ChatStreamOptions"},"CreatedKeyResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"created_s":{"type":"integer","title":"Created S"},"revoked_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revoked S"},"key":{"type":"string","title":"Key"}},"type":"object","required":["id","name","prefix","created_s","revoked_s","key"],"title":"CreatedKeyResponse"},"CreatedTempKey":{"properties":{"key":{"type":"string","title":"Key"},"kind":{"type":"string","enum":["trial","account_session"],"title":"Kind"},"expires_s":{"type":"integer","title":"Expires S"},"remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Remaining"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"model":{"type":"string","title":"Model"},"billing":{"type":"string","enum":["free","account"],"title":"Billing"},"has_credit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Credit"}},"type":"object","required":["key","kind","expires_s","remaining","limit","models","model","billing","has_credit"],"title":"CreatedTempKey"},"CryptoConfigResponse":{"properties":{"payment_method":{"type":"string","title":"Payment Method","default":"usdc"},"networks":{"items":{"$ref":"#/components/schemas/NetworkResponse"},"type":"array","title":"Networks"}},"type":"object","required":["networks"],"title":"CryptoConfigResponse"},"CurrentSessionResponse":{"properties":{"user_account":{"$ref":"#/components/schemas/UserAccountResponse"},"session":{"$ref":"#/components/schemas/SessionResponse"}},"type":"object","required":["user_account","session"],"title":"CurrentSessionResponse"},"EmailComplete":{"properties":{"signup_id":{"type":"string","maxLength":64,"minLength":32,"title":"Signup Id"},"code":{"type":"string","maxLength":12,"minLength":4,"title":"Code"},"session_delivery":{"type":"string","enum":["cookie","bearer"],"title":"Session Delivery","default":"bearer"}},"additionalProperties":false,"type":"object","required":["signup_id","code"],"title":"EmailComplete"},"EmailStart":{"properties":{"email":{"type":"string","maxLength":254,"minLength":3,"title":"Email"}},"additionalProperties":false,"type":"object","required":["email"],"title":"EmailStart"},"EmailStarted":{"properties":{"signup_id":{"type":"string","title":"Signup Id"},"status":{"type":"string","const":"code_sent","title":"Status","default":"code_sent"},"expires_s":{"type":"integer","title":"Expires S"}},"type":"object","required":["signup_id","expires_s"],"title":"EmailStarted"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoiceRequest":{"properties":{"chain":{"type":"string","enum":["solana","ethereum"],"title":"Chain"},"amount_cents":{"type":"integer","maximum":100000.0,"minimum":500.0,"title":"Amount Cents"}},"type":"object","required":["chain","amount_cents"],"title":"InvoiceRequest"},"InvoiceResponse":{"properties":{"id":{"type":"string","title":"Id"},"chain":{"type":"string","enum":["solana","ethereum"],"title":"Chain"},"recipient":{"type":"string","title":"Recipient"},"amount_usdc":{"type":"string","title":"Amount Usdc"},"credit_usd":{"type":"string","title":"Credit Usd"},"created_s":{"type":"integer","title":"Created S"},"expires_s":{"type":"integer","title":"Expires S"},"status":{"type":"string","title":"Status"},"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id"}},"type":"object","required":["id","chain","recipient","amount_usdc","credit_usd","created_s","expires_s","status","transaction_id"],"title":"InvoiceResponse"},"KeyListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/KeyResponse"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"KeyListResponse"},"KeyRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","default":"API key"}},"additionalProperties":false,"type":"object","title":"KeyRequest"},"KeyResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"created_s":{"type":"integer","title":"Created S"},"revoked_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revoked S"}},"type":"object","required":["id","name","prefix","created_s","revoked_s"],"title":"KeyResponse"},"Model":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"model","title":"Object"},"created":{"type":"integer","title":"Created"},"owned_by":{"type":"string","title":"Owned By"}},"type":"object","required":["id","object","created","owned_by"],"title":"Model"},"ModelList":{"properties":{"object":{"type":"string","const":"list","title":"Object"},"data":{"items":{"$ref":"#/components/schemas/Model"},"type":"array","title":"Data"}},"type":"object","required":["object","data"],"title":"ModelList"},"NetworkResponse":{"properties":{"chain":{"type":"string","enum":["solana","ethereum"],"title":"Chain"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["chain","enabled"],"title":"NetworkResponse"},"ReasoningOptions":{"properties":{"effort":{"type":"string","enum":["none","low"],"title":"Effort","default":"low"}},"additionalProperties":false,"type":"object","title":"ReasoningOptions"},"ResponsesRequest":{"properties":{"model":{"type":"string","minLength":1,"title":"Model"},"input":{"type":"string","minLength":1,"title":"Input"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"},"previous_response_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Response Id"},"stream":{"type":"boolean","title":"Stream","default":false},"max_output_tokens":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Output Tokens"},"reasoning":{"anyOf":[{"$ref":"#/components/schemas/ReasoningOptions"},{"type":"null"}],"description":"Use effort low to enable thinking. Output limits and usage include reasoning."}},"additionalProperties":false,"type":"object","required":["model","input"],"title":"ResponsesRequest"},"SessionResponse":{"properties":{"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"expires_s":{"type":"integer","title":"Expires S"},"expires_in":{"type":"integer","title":"Expires In"},"method":{"type":"string","enum":["email","wallet"],"title":"Method"},"csrf_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csrf Token"}},"type":"object","required":["expires_s","expires_in","method"],"title":"SessionResponse"},"TempKeyRequest":{"properties":{"kind":{"type":"string","enum":["trial","account_session"],"title":"Kind"}},"additionalProperties":false,"type":"object","required":["kind"],"title":"TempKeyRequest"},"UserAccountResponse":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"wallet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet"},"credit_balance_usd":{"type":"string","title":"Credit Balance Usd"}},"type":"object","required":["id","email","wallet","credit_balance_usd"],"title":"UserAccountResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyRequest":{"properties":{"transaction_id":{"type":"string","maxLength":88,"minLength":64,"title":"Transaction Id"}},"type":"object","required":["transaction_id"],"title":"VerifyRequest"},"WalletChallenge":{"properties":{"signup_id":{"type":"string","title":"Signup Id"},"wallet":{"type":"string","title":"Wallet"},"message":{"type":"string","title":"Message"},"expires_s":{"type":"integer","title":"Expires S"},"signature_encoding":{"type":"string","title":"Signature Encoding","default":"base64"},"payment_required":{"type":"boolean","title":"Payment Required"},"invoice":{"anyOf":[{"$ref":"#/components/schemas/InvoiceResponse"},{"type":"null"}]}},"type":"object","required":["signup_id","wallet","message","expires_s","payment_required","invoice"],"title":"WalletChallenge"},"WalletSessionComplete":{"properties":{"signup_id":{"type":"string","maxLength":64,"minLength":32,"title":"Signup Id"},"signature":{"type":"string","maxLength":88,"minLength":88,"title":"Signature"},"transaction_id":{"anyOf":[{"type":"string","maxLength":88,"minLength":64},{"type":"null"}],"title":"Transaction Id"},"session_delivery":{"type":"string","enum":["cookie","bearer"],"title":"Session Delivery","default":"bearer"}},"additionalProperties":false,"type":"object","required":["signup_id","signature"],"title":"WalletSessionComplete"},"WalletStart":{"properties":{"wallet":{"type":"string","maxLength":44,"minLength":32,"title":"Wallet"},"recover_signup_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":32},{"type":"null"}],"title":"Recover Signup Id"}},"additionalProperties":false,"type":"object","required":["wallet"],"title":"WalletStart"}},"securitySchemes":{"SMApiKey":{"type":"http","description":"Permanent sm_ key from POST /v1/api_keys for inference, balance checks and USDC funding. Legacy sis_ keys remain valid in this deployment. Temporary sis_tmp_ keys authorize chat only. Inference keys cannot manage API keys or sessions.","scheme":"bearer"},"AccountSession":{"type":"http","description":"Account session from completing email or wallet signup/sign-in. Use for session and API-key management. Browser cookies require X-CSRF-Token for changes.","scheme":"bearer"}}}}