{"id":25636304,"url":"https://github.com/thesurlydev/claude-client","last_synced_at":"2026-06-23T07:31:49.255Z","repository":{"id":278473007,"uuid":"935738320","full_name":"thesurlydev/claude-client","owner":"thesurlydev","description":"Rust Claude client","archived":false,"fork":false,"pushed_at":"2025-02-25T16:07:49.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-10T00:05:08.462Z","etag":null,"topics":["antropic","claude","client","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thesurlydev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-19T23:58:35.000Z","updated_at":"2025-04-20T00:22:53.000Z","dependencies_parsed_at":"2025-02-20T00:34:09.074Z","dependency_job_id":"d3cbd73f-f46b-4def-aabf-7421733c016c","html_url":"https://github.com/thesurlydev/claude-client","commit_stats":null,"previous_names":["thesurlydev/claude-client"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thesurlydev/claude-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesurlydev%2Fclaude-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesurlydev%2Fclaude-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesurlydev%2Fclaude-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesurlydev%2Fclaude-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thesurlydev","download_url":"https://codeload.github.com/thesurlydev/claude-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesurlydev%2Fclaude-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34680620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antropic","claude","client","rust"],"created_at":"2025-02-23T00:41:31.795Z","updated_at":"2026-06-23T07:31:49.250Z","avatar_url":"https://github.com/thesurlydev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claude-client\n\nA Rust client for the [Claude](https://claude.ai/) API. This client provides a simple interface to interact with Claude's API, including sending messages and listing available models.\n\n## Features\n\n- Send messages to Claude with optional system prompts\n- List available Claude models\n- Built-in error handling and type safety\n- Async/await support using tokio\n- Default to latest Claude model (claude-3-7-sonnet-20250219)\n\n## Building and Testing\n\n### Prerequisites\n\n- Rust 1.75 or later\n- An Anthropic API key for running tests\n\n### Building\n\nTo build the project:\n\n```sh\ncargo build\n```\n\n### Running Tests\n\nThe test suite includes both unit tests and integration tests. The integration tests require a valid Anthropic API key to be set in the environment:\n\n```sh\n# Set your API key\nexport ANTHROPIC_API_KEY=\"your_api_key_here\"\n\n# Run all tests\ncargo test\n\n# Run only unit tests\ncargo test --lib\n\n# Run only integration tests\ncargo test --test integration_test\n```\n\nIf no API key is set, the integration tests will be skipped automatically.\n\n## Usage\n\nFirst, set your Anthropic API key as an environment variable:\n\n```sh\nexport ANTHROPIC_API_KEY=\"your_api_key_here\"\n```\n\n### Basic Usage\n\n```rust\nuse claude_client::claude::ClaudeClient;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Initialize the client\n    let client = ClaudeClient::new()?;\n\n    // Send a message using the default model (claude-3-7-sonnet-20250219)\n    let response = client\n        .send_message(\n            None,\n            \"You are a helpful assistant.\",\n            \"What is the capital of France?\"\n        )\n        .await?;\n    println!(\"Response: {}\", response);\n\n    Ok(())\n}\n```\n\n### Using a Specific Model\n\n```rust\nuse claude_client::claude::ClaudeClient;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let client = ClaudeClient::new()?;\n\n    // Send a message using a specific model\n    let response = client\n        .send_message(\n            Some(\"claude-3-opus-20240229\"),\n            \"You are a helpful assistant.\",\n            \"What is the capital of France?\"\n        )\n        .await?;\n    println!(\"Response: {}\", response);\n\n    Ok(())\n}\n```\n\n### Listing Available Models\n\n```rust\nuse claude_client::claude::ClaudeClient;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let client = ClaudeClient::new()?;\n\n    // Get a list of available models\n    let models = client.list_models().await?;\n\n    // Print model information\n    for model in models {\n        println!(\"Model ID: {}\", model.id);\n        println!(\"Display Name: {}\", model.display_name);\n        println!(\"Created At: {}\", model.created_at);\n        println!(\"---\");\n    }\n\n    Ok(())\n}\n```\n\n## Error Handling\n\nThe client uses Rust's `Result` type for error handling. All errors are wrapped in a `Box\u003cdyn std::error::Error\u003e`. Common errors include:\n\n- Missing or invalid API key\n- Network connectivity issues\n- Invalid model selection\n- API rate limits\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesurlydev%2Fclaude-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthesurlydev%2Fclaude-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesurlydev%2Fclaude-client/lists"}