Skip to content

Get‑ShpModel

Raimund edited this page Sep 7, 2026 · 4 revisions

SYNOPSIS

Lists Copilot models available at one or more API endpoints.

SYNTAX

Get-ShpModel [[-Endpoint] <String>] [[-TokenPath] <String>] [[-GitHubHost] <String>]
 [[-EditorVersion] <String>] [[-PluginVersion] <String>] [[-UserAgent] <String>] [[-IntegrationId] <String>]
 [[-TimeoutSec] <Int32>] [[-MaxRetryCount] <Int32>] [[-RetryDelaySec] <Int32>]
 [[-NetworkOutageToleranceSec] <Int32>] [<CommonParameters>]

DESCRIPTION

Obtains a session token, then queries the /models endpoint for each selected base URL and emits one object per model (Endpoint, Id, ServiceType, and the Raw model record). Endpoints that fail to respond produce a warning rather than terminating the call.

Each model's advertised context window and output cap are also recorded in a module-scoped cache as a side effect. That cache is what lets the context-window guard in Invoke-Shp size itself from the model in use without issuing a request of its own, so calling this cmdlet once per session makes every later turn's guard fire at the right point instead of at the built-in fallback. The cache is discarded by Initialize-Shp on re-auth and is never persisted to disk.

EXAMPLES

EXAMPLE 1

Get-ShpModel

Lists the models available at the Enterprise endpoint.

EXAMPLE 2

Get-ShpModel -Endpoint All | Sort-Object Id

Lists models across every known endpoint, sorted by id.

PARAMETERS

-EditorVersion

Editor-Version header value sent with the request.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: $script:DefaultEditorVersion
Accept pipeline input: False
Accept wildcard characters: False

-Endpoint

Which endpoint(s) to query: Enterprise, Individual, Default, Session (the per-account endpoint from the session token), or All. Default: Enterprise.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: Enterprise
Accept pipeline input: False
Accept wildcard characters: False

-GitHubHost

HTTPS GitHub.com or Enterprise Cloud GHE.com authentication origin. Explicit value wins over Session context and SHELLPILOT_GITHUB_HOST. For an enterprise host every endpoint selection uses the service-returned per-account API endpoint. An absent endpoint is refused, never guessed or replaced with the GitHub.com fallback map. An explicit host lookup does not populate the shared session model-limit cache. To warm that cache, set GitHubHost through Set-ShpContext and call Get-ShpModel without a per-call host override.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IntegrationId

Copilot-Integration-Id header value sent with the request.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: $script:DefaultIntegrationId
Accept pipeline input: False
Accept wildcard characters: False

-MaxRetryCount

Maximum retries on a transient (429/5xx) HTTP failure. Falls back to the session context and then the built-in default.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-NetworkOutageToleranceSec

Wall-clock budget, in seconds, for riding out a connection-level network outage. Falls back to the session context and then the built-in default. 0 disables outage tolerance.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-PluginVersion

Editor-Plugin-Version header value sent with the request.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: $script:DefaultPluginVersion
Accept pipeline input: False
Accept wildcard characters: False

-RetryDelaySec

Base delay in seconds for the exponential backoff between retries. Falls back to the session context and then the built-in default.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-TimeoutSec

Per-request HTTP timeout in seconds. Falls back to the session context (Set-ShpContext) and then to the built-in default of 0, meaning no explicit timeout.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-TokenPath

Path to an OAuth token file to authenticate with. Omit it to resolve the token by the module's precedence: the session context (Set-ShpContext -GitHubToken), then $env:SHELLPILOT_GITHUB_TOKEN, then the default token file written by Initialize-Shp.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-UserAgent

User-Agent header value sent with the request.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: $script:DefaultUserAgent
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Management.Automation.PSCustomObject

One object per model with Endpoint, Id, ServiceType, MaxContextWindowTokens,

MaxOutputTokens, ReasoningEfforts, and Raw members. The capability

fields are populated from the model's advertised metadata when present

(and are $null for endpoints that do not return it).

NOTES

RELATED LINKS

Get-ShpModelName

Invoke-Shp

Clone this wiki locally