Module: BlackmanClient

Defined in:
lib/blackman_client/version.rb,
lib/blackman_client.rb,
lib/blackman_client/api_error.rb,
lib/blackman_client/api_client.rb,
lib/blackman_client/models/usage.rb,
lib/blackman_client/configuration.rb,
lib/blackman_client/models/choice.rb,
lib/blackman_client/models/message.rb,
lib/blackman_client/models/provider.rb,
lib/blackman_client/api/feedback_api.rb,
lib/blackman_client/models/image_url.rb,
lib/blackman_client/api/completions_api.rb,
lib/blackman_client/models/content_part.rb,
lib/blackman_client/api/semantic_cache_api.rb,
lib/blackman_client/models/message_content.rb,
lib/blackman_client/models/completion_options.rb,
lib/blackman_client/models/completion_request.rb,
lib/blackman_client/models/completion_response.rb,
lib/blackman_client/models/content_part_one_of.rb,
lib/blackman_client/models/invalidate_response.rb,
lib/blackman_client/models/content_part_one_of1.rb,
lib/blackman_client/models/semantic_cache_stats.rb,
lib/blackman_client/models/semantic_cache_config.rb,
lib/blackman_client/models/submit_feedback_request.rb,
lib/blackman_client/models/submit_feedback_response.rb

Overview

#Blackman AI API

#A transparent AI API proxy that optimizes token usage to reduce costs. ## Authentication Blackman AI supports two authentication methods: ### 1. API Key (Recommended for integrations) Use the API key created from your dashboard: bash curl -X POST https://app.useblackman.ai/v1/completions \\ -H \"Authorization: Bearer sk_your_api_key_here\" \\ -H \"Content-Type: application/json\" \\ -d '{\"provider\": \"OpenAI\", \"model\": \"gpt-4\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]}' ### 2. JWT Token (For web UI) Obtain a JWT token by logging in: bash curl -X POST https://app.useblackman.ai/v1/auth/login \\ -H \"Content-Type: application/json\" \\ -d '{\"email\": \"[email protected]\", \"password\": \"yourpassword\"}' Then use the token: bash curl -X POST https://app.useblackman.ai/v1/completions \\ -H \"Authorization: Bearer your_jwt_token\" \\ -H \"Content-Type: application/json\" \\ -d '{...}' ### Provider API Keys (Optional) You can optionally provide your own LLM provider API key via the X-Provider-Api-Key header, or store it in your account settings. ## Client SDKs Auto-generated SDKs are available for 10 languages: - TypeScript: View Docs - Python: View Docs - Go: View Docs - Java: View Docs - Ruby: View Docs - PHP: View Docs - C#: View Docs - Rust: View Docs - Swift: View Docs - Kotlin: View Docs All SDKs are generated from this OpenAPI spec using openapi-generator. ## Quick Start python # Python example with API key import blackman_client from blackman_client import CompletionRequest configuration = blackman_client.Configuration( host=\"http://localhost:8080\", access_token=\"sk_your_api_key_here\" # Your Blackman API key ) with blackman_client.ApiClient(configuration) as api_client: api = blackman_client.CompletionsApi(api_client) response = api.completions( CompletionRequest( provider=\"OpenAI\", model=\"gpt-4o\", messages=[{\"role\": \"user\", \"content\": \"Hello!\"}] ) )

The version of the OpenAPI document: 0.1.0

Generated by: https://openapi-generator.tech Generator version: 7.14.0

Defined Under Namespace

Modules: ContentPart, MessageContent Classes: ApiClient, ApiError, Choice, CompletionOptions, CompletionRequest, CompletionResponse, CompletionsApi, Configuration, ContentPartOneOf, ContentPartOneOf1, FeedbackApi, ImageUrl, InvalidateResponse, Message, Provider, SemanticCacheApi, SemanticCacheConfig, SemanticCacheStats, SubmitFeedbackRequest, SubmitFeedbackResponse, Usage

Constant Summary collapse

VERSION =
'0.0.10'

Class Method Summary collapse

Class Method Details

.configureObject

Customize default settings for the SDK using block. BlackmanClient.configure do |config| config.username = "xxx" config.password = "xxx" end If no block given, return the default Configuration object.



51
52
53
54
55
56
57
# File 'lib/blackman_client.rb', line 51

def configure
  if block_given?
    yield(Configuration.default)
  else
    Configuration.default
  end
end