Skip to content
GorshkovIvanPublic

About

New API sharing standard for AI and Data companies.

Resources

Stars

5 stars

Watchers

3 watching

Forks

Repository files navigation

KeyFlow

KeyFlow enables secondary market trading for API credits issued by machine learning (ML) and cloud computing providers. Each API key is transformed into a unique token, facilitating seamless resale and allowing providers to earn royalties while enhancing access to AI services.

Features

  • Developer Tool: Convert API credits to tokens on BASE.
  • Tokenized Credits: Easy transfer and sale of tokenized credits.
  • Frontend Integration: Simple frontend integration.
  • API Marketplace: Fully built and functioning API marketplace.
  • Paymaster Integration: Streamlined payment solutions.
  • Mistral AI chat wrapper: To demonstrate keyflow capabilities.
  • Provider Commission: API Provider can set a custom commission for each resell.

Directory Structure

  • encode_frontend: API marketplace.
  • encode_hack_smart_contracts: Smart contract interactions.
  • encode_proj_backend: Website backend.
  • encode_proj_deployment: Deployment script.

KeyFlow Architecture

architecture-diagram

Keyflow allows users to convert API credits from multiple providers to tokens, redistributing the value of the credits to the users. The architecture is designed to be modular, allowing for easy integration of new providers.

Each provider has its own smart contract deployed on BASE that converts API credits to tokens. Tokens are then listed on the marketplace, where users can buy and sell them. The marketplace is an application built on BASE, allowing for peer-to-peer trading of API credits.

Token Example

metamask-nft-showcase

Keyflow MistralAI chat wrapper

keyflow chat demo

Owning API credits with KeyFlow allows you to use the API of the associated provider. In this example, we use the Mistral AI chat wrapper. When making a request in the chat-demo, the request is signed with user's wallet and verified on the backend. Backend verifies the signature, checks remaining credits and makes a request to the provider's API on behalf of the user.

Key points:

  • Credits remaining credits are automatically updated when new requests are made.
  • Ownership verification happens via SIWE protocol.
  • Demo's API is integrated with Mistral AI

Keyflow Marketplace

keyflow marketplace screenshots

The marketplace is an application built on BASE, allowing for peer-to-peer trading of API credits.

Users can explore market for available credits by API providers and purchase them. Track their owned credits and list them for sale.

Key points:

  • Providers can set a custom commission for each resell. Making second-hand market economically sustainable for them, as each resell increases price per credit.
  • Credits are grouped by API provider, making it easier to compare and purchase.
  • Listing and delisting of credits is instant.

Paymaster Enabled Gasless Transactions

paymaster enabled gasless transactions

KeyFlow supports Paymaster for payments.

About

New API sharing standard for AI and Data companies.

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages