Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/1rgs/claude-code-proxy
/ functions
Functions
27 in github.com/1rgs/claude-code-proxy
⨍
Functions
27
◇
Types & classes
17
↳
Endpoints
3
↓ 3 callers
Function
log_request_beautifully
Log requests in a beautiful, twitter-friendly format showing Claude to OpenAI mapping.
server.py:1664
↓ 2 callers
Method
add_event
Track information about each received event.
tests.py:383
↓ 2 callers
Function
convert_anthropic_to_litellm
Convert Anthropic API request format to LiteLLM format (which follows OpenAI).
server.py:464
↓ 2 callers
Function
get_response
Send a request and get the response.
tests.py:199
↓ 2 callers
Function
stream_response
Send a streaming request and process the response.
tests.py:445
↓ 2 callers
Method
summarize
Print a summary of the stream statistics.
tests.py:426
↓ 1 callers
Function
clean_gemini_schema
Recursively removes unsupported fields from a JSON schema for Gemini.
server.py:132
↓ 1 callers
Function
compare_responses
Compare the two responses to see if they're similar enough.
tests.py:208
↓ 1 callers
Function
compare_stream_stats
Compare the statistics from the two streams to see if they're similar enough.
tests.py:527
↓ 1 callers
Function
convert_litellm_to_anthropic
Convert LiteLLM (OpenAI format) response to Anthropic API response format.
server.py:730
↓ 1 callers
Method
get_duration
Calculate the total duration of the stream in seconds.
tests.py:420
↓ 1 callers
Function
handle_streaming
Handle streaming responses from LiteLLM and convert to Anthropic format.
server.py:922
↓ 1 callers
Function
main
()
tests.py:697
↓ 1 callers
Function
run_tests
Run all tests based on command-line arguments.
tests.py:634
↓ 1 callers
Function
sanitize_for_json
递归地清理对象使其可以JSON序列化
server.py:1532
↓ 1 callers
Function
test_request
Run a test with the given request data.
tests.py:318
↓ 1 callers
Function
test_streaming
Run a streaming test with the given request data.
tests.py:568
Method
__init__
(self)
tests.py:369
Function
count_tokens
(request: TokenCountRequest, raw_request: Request)
server.py:1568
Function
create_message
(request: MessagesRequest, raw_request: Request)
server.py:1215
Method
filter
(self, record)
server.py:39
Method
format
(self, record)
server.py:72
Function
log_requests
(request: Request, call_next)
server.py:402
Function
parse_tool_result_content
Helper function to properly parse and normalize tool result content.
server.py:419
Function
root
()
server.py:1646
Method
validate_model_field
(cls, v, info)
server.py:230
Method
validate_model_token_count
(cls, v, info)
server.py:310