MCPcopy Create free account

hub / github.com/TQZHR/grok2api / functions

Functions1,181 in github.com/TQZHR/grok2api

↓ 2 callersFunctionmake_response_object
(model: str, response_id: str, artifacts: ChatArtifacts)
app/services/compat/responses_api.py:100
↓ 2 callersMethodmark_asset_clear
Record online asset cleanup timestamp.
app/services/token/manager.py:404
↓ 2 callersFunctionmessages_create
( *, model: str, messages: list[dict[str, Any]], system: str | list[Any] | None, stream: b
app/services/compat/anthropic_api.py:91
↓ 2 callersFunctionnextLocalMidnightExpirationSeconds
(now = nowMs(), tzOffsetMinutes: number)
src/kv/cleanup.ts:34
↓ 2 callersFunctionnonEmptyPromptOrError
(prompt: string)
src/routes/openai.ts:1113
↓ 2 callersFunctionnormalizeGeneratedAssetUrls
(input: unknown)
src/grok/processor.ts:146
↓ 2 callersFunctionnormalizeGeneratedImageUrls
(input: unknown)
src/routes/openai.ts:254
↓ 2 callersFunctionnormalizeSsoToken
(raw: string)
src/routes/admin.ts:74
↓ 2 callersFunctionnormalizeTokenRecord
(pool, raw)
app/static/token/token.js:67
↓ 2 callersFunctionpad2
(n: number)
src/repo/apiKeyUsage.ts:17
↓ 2 callersFunctionparseChunk
(line: string)
src/grok/compat.ts:129
↓ 2 callersFunctionparseImageCount
(input: unknown)
src/routes/openai.ts:517
↓ 2 callersFunctionparseImageModel
(input: unknown, fallback: string)
src/routes/openai.ts:527
↓ 2 callersFunctionparseImagePrompt
(input: unknown)
src/routes/openai.ts:523
↓ 2 callersFunctionparseImageStream
(input: unknown)
src/routes/openai.ts:531
↓ 2 callersFunctionparseIntSafe
(v: string | undefined, fallback: number)
src/routes/media.ts:29
↓ 2 callersFunctionparseQuotaValue
(v)
app/static/token/token.js:40
↓ 2 callersFunctionparseTags
(tagsJson: string)
src/repo/tokens.ts:24
↓ 2 callersFunctionparse_sso_pair
(raw_token: str)
app/services/account/account_settings_refresh.py:31
↓ 2 callersFunctionparse_tool_calls
(text: str, available_tools: list[str] | None = None)
app/services/compat/tooling.py:123
↓ 2 callersMethodprocess
处理并收集图片
app/services/grok/processor.py:549
↓ 2 callersFunctionprocessBatchQueue
()
app/static/cache/cache.js:1091
↓ 2 callersFunctionprocessBatchQueue
()
app/static/token/token.js:978
↓ 2 callersFunctionprocessDeleteQueue
()
app/static/cache/cache.js:1204
↓ 2 callersFunctionprocessDeleteQueue
()
app/static/token/token.js:1166
↓ 2 callersFunctionrandomString
(length: number, lettersOnly = true)
src/grok/headers.ts:19
↓ 2 callersFunctionreadToolCalls
(chat: Record<string, unknown>)
src/grok/compat.ts:25
↓ 2 callersFunctionrefresh_account_settings_for_tokens
( tokens: Iterable[str], concurrency: int | None = None, retries: int | None = None, )
app/services/account/account_settings_refresh.py:176
↓ 2 callersMethodreload
重新加载 Token 池数据
app/services/token/manager.py:91
↓ 2 callersFunctionrenderAccountTable
(data)
app/static/cache/cache.js:342
↓ 2 callersFunctionrequestDeleteLocalFile
(type, name)
app/static/cache/cache.js:870
↓ 2 callersMethodreset
重置配额到默认值
app/services/token/models.py:149
↓ 2 callersFunctionresetImageContinuousMetrics
(resetCount)
app/static/chat/chat.js:502
↓ 2 callersFunctionresolveImageResponseFormatByMethodOrError
( raw: unknown, defaultMode: string, imageMethod: ReturnType<typeof resolveImageGenerationMethod>, )
src/routes/openai.ts:1162
↓ 2 callersFunctionresolve_aspect_ratio
(size: Optional[str])
app/api/v1/image.py:244
↓ 2 callersFunctionresolve_image_generation_method
(raw: Any)
app/services/grok/imagine_experimental.py:45
↓ 2 callersFunctionresolve_image_response_format
Keep legacy behavior, but for experimental imagine path: if caller does not explicitly provide response_format and global default is `url`,
app/api/v1/image.py:213
↓ 2 callersFunctionresponseUsage
(chat: Record<string, unknown>)
src/grok/compat.ts:30
↓ 2 callersFunctionresponse_field_name
(response_format: str)
app/api/v1/image.py:230
↓ 2 callersFunctionrunImageCall
(args: { requestModel: string; prompt: string; fileIds: string[]; cookie: string; settings: Awaited<
src/routes/openai.ts:572
↓ 2 callersFunctionrunImageStreamCall
(args: { requestModel: string; prompt: string; fileIds: string[]; cookie: string; settings: Awaited<
src/routes/openai.ts:611
↓ 2 callersFunctionrunTasksSettledWithLimit
( items: T[], limit: number, fn: (item: T) => Promise<R>, )
src/routes/openai.ts:74
↓ 2 callersFunctionsaveSettings
( env: Env, updates: { global_config?: GlobalSettings; grok_config?: GrokSettings; token_confi
src/settings.ts:216
↓ 2 callersMethodsave_config
(self, data: Dict[str, Any])
app/core/storage.py:609
↓ 2 callersMethodselect
选择一个可用 Token 策略: 1. 选择 active 状态且有配额的 token 2. 优先选择剩余额度最多的 3. 如果额度相同,随机选择(避免并发冲突)
app/services/token/pool.py:31
↓ 2 callersFunctionsendExperimentalImageEditRequest
(args: { prompt: string; fileUris: string[]; cookie: string; settings: GrokSettings; })
src/grok/imagineExperimental.ts:330
↓ 2 callersFunctionserializeCreds
(creds)
app/static/common/admin-auth.js:119
↓ 2 callersFunctionsetLoading
(loading)
app/static/keys/keys.js:114
↓ 2 callersFunctionsetNsfwRefreshUiEnabled
(enabled)
app/static/token/token.js:176
↓ 2 callersFunctionshowCacheSection
(type)
app/static/cache/cache.js:722
↓ 2 callersFunctionstartBatchDelete
(tokens)
app/static/cache/cache.js:1186
↓ 2 callersFunctionstopRun
(sendStatus: boolean)
src/routes/admin.ts:428
↓ 2 callersFunctionstreamChat
(body, bubbleEl, commitHistory = true)
app/static/chat/chat.js:1013
↓ 2 callersFunctionsyncSelectAllState
()
app/static/cache/cache.js:579
↓ 2 callersFunctiontoAbsoluteUrl
(url)
app/static/chat/chat.js:48
↓ 2 callersFunctiontoImageDataUrl
(raw)
app/static/chat/chat.js:70
↓ 2 callersFunctiontoIsoDateKey
(ts: number)
src/repo/logs.ts:75
↓ 2 callersFunctiontoIsoHourKey
(ts: number)
src/repo/logs.ts:66
↓ 2 callersFunctiontoMb
(b: number)
src/routes/admin.ts:214
↓ 2 callersFunctiontry_parse_json
(body: bytes)
scripts/smoke_test.py:60
↓ 2 callersFunctionupdateApiKeyName
(db: Env["DB"], key: string, name: string)
src/repo/apiKeys.ts:127
↓ 2 callersFunctionupdateStorageModeButton
()
app/static/common/admin-auth.js:228
↓ 2 callersMethodupdate_quota
更新配额(用于 API 同步) Args: new_quota: 新的配额值
app/services/token/models.py:101
↓ 2 callersFunctionuploadImages
(files)
app/static/chat/chat.js:900
↓ 2 callersFunctionupsertCacheRow
(db: Env["DB"], row: CacheRow)
src/repo/cache.ts:16
↓ 2 callersMethodusage_for_day
返回指定 day 的 usage map: { key: {chat_used,...} }
app/services/api_keys.py:324
↓ 2 callersFunctionvalidateApiKey
(db: Env["DB"], key: string)
src/repo/apiKeys.ts:167
↓ 2 callersFunctionwsSleep
(ms: number)
src/routes/admin.ts:135
↓ 2 callersFunctionxorCipher
(bytes, keyBytes)
app/static/common/admin-auth.js:25
↓ 1 callersMethod__init__
(self, proxy: str = None)
app/services/grok/assets.py:149
↓ 1 callersFunction_apply_legacy_config
Merge legacy settings into current config: - fill missing keys - override keys that are still default values
app/core/config.py:142
↓ 1 callersFunction_as_int
(value: str | None, default: int)
scripts/wait_for_storage.py:19
↓ 1 callersFunction_build_choice_instruction
(tool_choice: Any)
app/services/compat/tooling.py:214
↓ 1 callersMethod_build_headers
构建请求头
app/services/grok/usage.py:47
↓ 1 callersMethod_build_proxies
构建代理配置
app/services/grok/usage.py:83
↓ 1 callersFunction_build_token_pattern
(token: str)
scripts/check_model_catalog_sync.py:45
↓ 1 callersMethod_build_video_html
构建视频 HTML 标签
app/services/grok/processor.py:298
↓ 1 callersMethod_build_video_html
(self, video_url: str, thumbnail_url: str = "")
app/services/grok/processor.py:375
↓ 1 callersMethod_build_ws_payload
( prompt: str, request_id: str, aspect_ratio: str = "2:3", )
app/services/grok/imagine_experimental.py:86
↓ 1 callersFunction_cache_local_url
(service: DownloadService, token: str, url: str)
app/services/compat/media.py:25
↓ 1 callersMethod_cache_path
获取缓存路径
app/services/grok/assets.py:555
↓ 1 callersMethod_cleanup
清理过期数据
app/services/request_stats.py:131
↓ 1 callersFunction_clear_one
(t: str)
app/api/v1/admin.py:1023
↓ 1 callersFunction_coerce_system
(system: str | list[Any] | None)
app/services/compat/anthropic_api.py:232
↓ 1 callersFunction_coerce_text
(value: Any)
app/services/compat/usage.py:17
↓ 1 callersFunction_coerce_tool_result
(message: dict[str, Any])
app/services/compat/common.py:244
↓ 1 callersFunction_collect_completion
(prepared, *, emit_think: bool)
app/services/compat/openai_chat.py:134
↓ 1 callersFunction_collect_imagine_batch
(token: str, prompt: str, aspect_ratio: str)
app/api/v1/admin.py:120
↓ 1 callersFunction_collect_message
(prepared, *, emit_think: bool)
app/services/compat/anthropic_api.py:114
↓ 1 callersFunction_collect_python_model_ids
(text: str)
scripts/check_model_catalog_sync.py:37
↓ 1 callersFunction_collect_response
(prepared, *, emit_think: bool)
app/services/compat/responses_api.py:168
↓ 1 callersFunction_collect_workers_model_ids
(text: str)
scripts/check_model_catalog_sync.py:41
↓ 1 callersMethod_dl_headers
构建下载请求头
app/services/grok/assets.py:194
↓ 1 callersFunction_experimental_stream_generation
( token: str, prompt: str, n: int, response_format: str, response_field: str, aspect_r
app/api/v1/image.py:354
↓ 1 callersFunction_ext_from_mime
(mime: str)
app/api/v1/uploads.py:20
↓ 1 callersMethod_extract_cookie_value
(cookie_str: str, name: str)
app/services/token/manager.py:158
↓ 1 callersFunction_extract_outermost_json_obj
(text: str)
app/services/compat/tooling.py:295
↓ 1 callersMethod_extract_progress
(msg: Dict[str, Any])
app/services/grok/imagine_experimental.py:123
↓ 1 callersMethod_extract_url
(msg: Dict[str, Any])
app/services/grok/imagine_experimental.py:115
↓ 1 callersMethod_feed_scanning
(self, chunk: str)
app/services/compat/tooling.py:168
← previousnext →401–500 of 1,181, ranked by callers